Skip to content

Commit

Permalink
fixes other tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mkangia committed Oct 20, 2024
1 parent 0acafcb commit 42ccfee
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 2 deletions.
5 changes: 4 additions & 1 deletion corehq/apps/app_manager/tests/test_media_suite.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
from unittest.mock import patch

import commcare_translations

from corehq import privileges
from corehq.apps.app_manager import id_strings
from corehq.apps.app_manager.suite_xml.generator import MediaSuiteGenerator
from corehq.apps.app_manager.models import (
Expand All @@ -25,7 +27,7 @@
from corehq.apps.app_manager.tests.util import TestXmlMixin, parse_normalize, patch_get_xform_resource_overrides
from corehq.apps.builds.models import BuildSpec
from corehq.apps.hqmedia.models import CommCareAudio, CommCareImage, CommCareVideo
from corehq.util.test_utils import softer_assert
from corehq.util.test_utils import softer_assert, privilege_enabled


class MediaSuiteTest(SimpleTestCase, TestXmlMixin):
Expand Down Expand Up @@ -291,6 +293,7 @@ def test_unused_media_removed(self, mock):
self.assertFalse(list(app.multimedia_map.keys()))


@privilege_enabled(privileges.APP_DEPENDENCIES)
class LocalizedMediaSuiteTest(SimpleTestCase, TestXmlMixin):
"""
For CC >= 2.21
Expand Down
4 changes: 4 additions & 0 deletions corehq/apps/app_manager/tests/test_suite.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
from django.test import SimpleTestCase

from corehq import privileges

from corehq.apps.app_manager.exceptions import SuiteValidationError
from corehq.apps.app_manager.models import (
Application,
Expand All @@ -20,6 +22,7 @@
)
from corehq.apps.hqmedia.models import HQMediaMapItem
from corehq.apps.userreports.models import ReportConfiguration
from corehq.util.test_utils import privilege_enabled


@patch_get_xform_resource_overrides()
Expand Down Expand Up @@ -89,6 +92,7 @@ def test_owner_name(self, *args):
def test_printing(self, *args):
self._test_generic_suite('app_print_detail', 'suite-print-detail')

@privilege_enabled(privileges.APP_DEPENDENCIES)
def test_report_module(self, *args):
from corehq.apps.userreports.tests.utils import get_sample_report_config

Expand Down
3 changes: 3 additions & 0 deletions corehq/apps/app_manager/tests/test_suite_assertions.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import commcare_translations

from corehq import privileges
from corehq.apps.app_manager.exceptions import UnknownInstanceError
from corehq.apps.app_manager.models import CustomAssertion
from corehq.apps.app_manager.tests.app_factory import AppFactory
Expand All @@ -10,6 +11,7 @@
TestXmlMixin,
patch_get_xform_resource_overrides,
)
from corehq.util.test_utils import privilege_enabled


@patch_get_xform_resource_overrides()
Expand All @@ -23,6 +25,7 @@ def test_no_case_assertions(self, *args):
self._test_generic_suite('app_no_case_sharing', 'suite-no-case-sharing')


@privilege_enabled(privileges.APP_DEPENDENCIES)
@patch_get_xform_resource_overrides()
class CustomSuiteAssertionsTest(SimpleTestCase, TestXmlMixin):
_instance_declaration = """<partial><instance id="casedb" src="jr://instance/casedb"/></partial>"""
Expand Down
4 changes: 3 additions & 1 deletion corehq/apps/app_manager/tests/test_suite_formats.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

from django.test import SimpleTestCase

from corehq import privileges
from corehq.apps.app_manager.models import (
Application,
DetailColumn,
Expand All @@ -12,9 +13,10 @@
)
from corehq.apps.app_manager.tests.app_factory import AppFactory
from corehq.apps.app_manager.tests.util import TestXmlMixin, patch_get_xform_resource_overrides
from corehq.util.test_utils import flag_enabled
from corehq.util.test_utils import flag_enabled, privilege_enabled


@privilege_enabled(privileges.APP_DEPENDENCIES)
@patch_get_xform_resource_overrides()
class SuiteFormatsTest(SimpleTestCase, TestXmlMixin):
file_path = ('data', 'suite')
Expand Down
3 changes: 3 additions & 0 deletions corehq/apps/app_manager/tests/test_suite_sorting.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from django.test import SimpleTestCase

from corehq import privileges
from corehq.apps.app_manager.models import (
Application,
CaseSearch,
Expand All @@ -14,6 +15,7 @@
SuiteMixin,
patch_get_xform_resource_overrides,
)
from corehq.util.test_utils import privilege_enabled


@patch_get_xform_resource_overrides()
Expand All @@ -23,6 +25,7 @@ class SuiteSortingTest(SimpleTestCase, SuiteMixin):
def test_multisort_suite(self, *args):
self._test_generic_suite('multi-sort', 'multi-sort')

@privilege_enabled(privileges.APP_DEPENDENCIES)
def test_sort_only_value_suite(self, *args):
self._test_generic_suite('sort-only-value', 'sort-only-value')
self._test_app_strings('sort-only-value')
Expand Down

0 comments on commit 42ccfee

Please sign in to comment.