diff --git a/corehq/apps/app_manager/tests/test_media_suite.py b/corehq/apps/app_manager/tests/test_media_suite.py index a45aa0869d26..5cba3fec711d 100644 --- a/corehq/apps/app_manager/tests/test_media_suite.py +++ b/corehq/apps/app_manager/tests/test_media_suite.py @@ -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 ( @@ -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): @@ -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 diff --git a/corehq/apps/app_manager/tests/test_suite.py b/corehq/apps/app_manager/tests/test_suite.py index d3e14ceb1e74..3cd83ac3574b 100644 --- a/corehq/apps/app_manager/tests/test_suite.py +++ b/corehq/apps/app_manager/tests/test_suite.py @@ -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, @@ -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() @@ -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 diff --git a/corehq/apps/app_manager/tests/test_suite_assertions.py b/corehq/apps/app_manager/tests/test_suite_assertions.py index 0d0e0e1aa2c8..b1099de3985c 100644 --- a/corehq/apps/app_manager/tests/test_suite_assertions.py +++ b/corehq/apps/app_manager/tests/test_suite_assertions.py @@ -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 @@ -10,6 +11,7 @@ TestXmlMixin, patch_get_xform_resource_overrides, ) +from corehq.util.test_utils import privilege_enabled @patch_get_xform_resource_overrides() @@ -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 = """""" diff --git a/corehq/apps/app_manager/tests/test_suite_formats.py b/corehq/apps/app_manager/tests/test_suite_formats.py index b92b3ee076c6..84751d2fdf05 100644 --- a/corehq/apps/app_manager/tests/test_suite_formats.py +++ b/corehq/apps/app_manager/tests/test_suite_formats.py @@ -4,6 +4,7 @@ from django.test import SimpleTestCase +from corehq import privileges from corehq.apps.app_manager.models import ( Application, DetailColumn, @@ -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') diff --git a/corehq/apps/app_manager/tests/test_suite_sorting.py b/corehq/apps/app_manager/tests/test_suite_sorting.py index 1b7bee7eeb8f..7beab42a19d6 100644 --- a/corehq/apps/app_manager/tests/test_suite_sorting.py +++ b/corehq/apps/app_manager/tests/test_suite_sorting.py @@ -1,5 +1,6 @@ from django.test import SimpleTestCase +from corehq import privileges from corehq.apps.app_manager.models import ( Application, CaseSearch, @@ -14,6 +15,7 @@ SuiteMixin, patch_get_xform_resource_overrides, ) +from corehq.util.test_utils import privilege_enabled @patch_get_xform_resource_overrides() @@ -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')