diff --git a/common/djangoapps/student/tests/test_views.py b/common/djangoapps/student/tests/test_views.py index ac724d6f847b..ca4702cea2db 100644 --- a/common/djangoapps/student/tests/test_views.py +++ b/common/djangoapps/student/tests/test_views.py @@ -192,8 +192,8 @@ class StudentDashboardTests(SharedModuleStoreTestCase, MilestonesTestCaseMixin, EMAIL_SETTINGS_ELEMENT_ID = "#actions-item-email-settings-0" ENABLED_SIGNALS = ['course_published'] MOCK_SETTINGS = { + 'DISABLE_START_DATES': False, 'FEATURES': { - 'DISABLE_START_DATES': False, 'ENABLE_MKTG_SITE': True, 'DISABLE_SET_JWT_COOKIES_FOR_TESTS': True, }, diff --git a/lms/djangoapps/branding/tests/test_page.py b/lms/djangoapps/branding/tests/test_page.py index 509d0509ddeb..e3da7a78781e 100644 --- a/lms/djangoapps/branding/tests/test_page.py +++ b/lms/djangoapps/branding/tests/test_page.py @@ -26,11 +26,6 @@ ) from xmodule.modulestore.tests.factories import CourseFactory # pylint: disable=wrong-import-order -FEATURES_WITH_STARTDATE = settings.FEATURES.copy() -FEATURES_WITH_STARTDATE['DISABLE_START_DATES'] = False -FEATURES_WO_STARTDATE = settings.FEATURES.copy() -FEATURES_WO_STARTDATE['DISABLE_START_DATES'] = True - def mock_render_to_response(*args, **kwargs): """ @@ -67,7 +62,7 @@ def get_headers(cache_response): return headers - @override_settings(FEATURES=FEATURES_WITH_STARTDATE) + @override_settings(DISABLE_START_DATES=False) def test_none_user_index_access_with_startdate_fails(self): """ This is a regression test for a bug where the incoming user is @@ -78,12 +73,12 @@ def test_none_user_index_access_with_startdate_fails(self): response = self.client.get(reverse('root')) assert response.status_code == 200 - @override_settings(FEATURES=FEATURES_WITH_STARTDATE) + @override_settings(DISABLE_START_DATES=False) def test_anon_user_with_startdate_index(self): response = self.client.get('/') assert response.status_code == 200 - @override_settings(FEATURES=FEATURES_WO_STARTDATE) + @override_settings(DISABLE_START_DATES=True) def test_anon_user_no_startdate_index(self): response = self.client.get('/') assert response.status_code == 200 diff --git a/lms/djangoapps/course_blocks/transformers/tests/test_start_date.py b/lms/djangoapps/course_blocks/transformers/tests/test_start_date.py index adac44c95dcb..affe2502ecaa 100644 --- a/lms/djangoapps/course_blocks/transformers/tests/test_start_date.py +++ b/lms/djangoapps/course_blocks/transformers/tests/test_start_date.py @@ -4,9 +4,9 @@ from datetime import timedelta -from unittest.mock import patch import ddt +from django.test.utils import override_settings from django.utils.timezone import now from common.djangoapps.student.tests.factories import BetaTesterFactory @@ -63,7 +63,7 @@ def setUp(self): # 3 4 / 5 # \ / # 6 - @patch.dict('django.conf.settings.FEATURES', {'DISABLE_START_DATES': False}) + @override_settings(DISABLE_START_DATES=False) @ddt.data( (STUDENT, {}, {}, {}), (STUDENT, {0: StartDateType.default}, {}, {}), diff --git a/lms/djangoapps/course_home_api/progress/tests/test_views.py b/lms/djangoapps/course_home_api/progress/tests/test_views.py index d91c1a2cad23..49ec170d97ef 100644 --- a/lms/djangoapps/course_home_api/progress/tests/test_views.py +++ b/lms/djangoapps/course_home_api/progress/tests/test_views.py @@ -7,6 +7,7 @@ import dateutil import ddt +from django.test.utils import override_settings from django.urls import reverse from django.utils.timezone import now from edx_toggles.toggles.testutils import override_waffle_flag @@ -160,7 +161,7 @@ def get_subsection_show_grades(response): assert response.status_code == 200 assert get_subsection_show_grades(response) is False - @patch.dict('django.conf.settings.FEATURES', {'DISABLE_START_DATES': False}) + @override_settings(DISABLE_START_DATES=False) def test_has_scheduled_content_data(self): CourseEnrollment.enroll(self.user, self.course.id) future = now() + timedelta(days=30) diff --git a/lms/djangoapps/courseware/access_utils.py b/lms/djangoapps/courseware/access_utils.py index 10044eac7fa2..4caaeb9f993a 100644 --- a/lms/djangoapps/courseware/access_utils.py +++ b/lms/djangoapps/courseware/access_utils.py @@ -77,7 +77,7 @@ def check_start_date(user, days_early_for_beta, start, course_key, display_error Returns: AccessResponse: Either ACCESS_GRANTED or StartDateError. """ - start_dates_disabled = settings.FEATURES["DISABLE_START_DATES"] + start_dates_disabled = settings.DISABLE_START_DATES masquerading_as_student = is_masquerading_as_student(user, course_key) if start_dates_disabled and not masquerading_as_student: diff --git a/lms/djangoapps/courseware/tests/test_about.py b/lms/djangoapps/courseware/tests/test_about.py index b34c29a7cb45..fa2231baac61 100644 --- a/lms/djangoapps/courseware/tests/test_about.py +++ b/lms/djangoapps/courseware/tests/test_about.py @@ -289,14 +289,14 @@ def setUp(self): # common/test/data/2014/about/overview.html self.xml_data = "about page 463139" - @patch.dict('django.conf.settings.FEATURES', {'DISABLE_START_DATES': False}) + @override_settings(DISABLE_START_DATES=False) def test_logged_in_xml(self): self.setup_user() url = reverse('about_course', args=[str(self.xml_course_id)]) resp = self.client.get(url) self.assertContains(resp, self.xml_data) - @patch.dict('django.conf.settings.FEATURES', {'DISABLE_START_DATES': False}) + @override_settings(DISABLE_START_DATES=False) def test_anonymous_user_xml(self): url = reverse('about_course', args=[str(self.xml_course_id)]) resp = self.client.get(url) diff --git a/lms/djangoapps/courseware/tests/test_access.py b/lms/djangoapps/courseware/tests/test_access.py index bd75d4723933..706e0f4a20d8 100644 --- a/lms/djangoapps/courseware/tests/test_access.py +++ b/lms/djangoapps/courseware/tests/test_access.py @@ -421,7 +421,7 @@ def test__has_access_to_block(self): (False, TOMORROW, access_response.StartDateError) ) @ddt.unpack - @patch.dict('django.conf.settings.FEATURES', {'DISABLE_START_DATES': False}) + @override_settings(DISABLE_START_DATES=False) def test__has_access_to_block_staff_lock(self, visible_to_staff_only, start, expected_error_type=None): """ Tests that "visible_to_staff_only" overrides start date. @@ -451,7 +451,7 @@ def test__has_access_to_block_beta_user(self): (YESTERDAY, None) ) # ddt throws an error if I don't put the None argument there @ddt.unpack - @patch.dict('django.conf.settings.FEATURES', {'DISABLE_START_DATES': False}) + @override_settings(DISABLE_START_DATES=False) def test__has_access_to_block_with_start_date(self, start, expected_error_type): """ Tests that block access follows start date rules. @@ -480,7 +480,7 @@ def test__has_access_to_block_with_start_date(self, start, expected_error_type): (True, True, TOMORROW, False), # Masquerading, future start date - no access ) @ddt.unpack - @patch.dict("django.conf.settings.FEATURES", {"DISABLE_START_DATES": False}) + @override_settings(DISABLE_START_DATES=False) def test_enforce_masquerade_start_dates_flag(self, flag_active, is_masquerading, start, expected_access=True): """ Test that the ENFORCE_MASQUERADE_START_DATES flag controls whether masquerading bypasses start date @@ -864,7 +864,7 @@ def setUp(self): @ddt.data(*(COURSE_TEST_DATA + LOAD_MOBILE_TEST_DATA + PREREQUISITES_TEST_DATA)) @ddt.unpack - @patch.dict('django.conf.settings.FEATURES', {'DISABLE_START_DATES': False}) + @override_settings(DISABLE_START_DATES=False) def test_course_overview_access(self, user_attr_name, action, course_attr_name): """ Check that a user's access to a course is equal to the user's access to @@ -904,7 +904,7 @@ def test_course_overview_unsupported_action(self): ) ) @ddt.unpack - @patch.dict('django.conf.settings.FEATURES', {'DISABLE_START_DATES': False}) + @override_settings(DISABLE_START_DATES=False) def test_course_catalog_access_num_queries(self, user_attr_name, action, course_attr_name): ContentTypeGatingConfig.objects.create(enabled=True, enabled_as_of=datetime.datetime(2018, 1, 1)) diff --git a/lms/djangoapps/courseware/tests/test_masquerade.py b/lms/djangoapps/courseware/tests/test_masquerade.py index b7c12df30aab..8611e4e04af1 100644 --- a/lms/djangoapps/courseware/tests/test_masquerade.py +++ b/lms/djangoapps/courseware/tests/test_masquerade.py @@ -303,7 +303,7 @@ def assertExpectedLanguageInPreference(self, user, expected_language_code): 'john', # Non-unicode username 'fôô@bar', # Unicode username with @, which is what the ENABLE_UNICODE_USERNAME feature allows ) - @patch.dict('django.conf.settings.FEATURES', {'DISABLE_START_DATES': False}) + @override_settings(DISABLE_START_DATES=False) def test_masquerade_as_specific_student(self, username): """ Test masquerading as a specific user. @@ -409,7 +409,7 @@ def setUp(self): self.course.user_partitions.append(self.user_partition) modulestore().update_item(self.course, self.test_user.id) - @patch.dict('django.conf.settings.FEATURES', {'DISABLE_START_DATES': False}) + @override_settings(DISABLE_START_DATES=False) def test_get_masquerade_group(self): """ Tests that a staff member can masquerade as being in a group in a user partition diff --git a/lms/djangoapps/courseware/tests/test_self_paced_overrides.py b/lms/djangoapps/courseware/tests/test_self_paced_overrides.py index 43a0c67d1ffd..6c3384ad5309 100644 --- a/lms/djangoapps/courseware/tests/test_self_paced_overrides.py +++ b/lms/djangoapps/courseware/tests/test_self_paced_overrides.py @@ -1,7 +1,6 @@ """Tests for self-paced course due date overrides.""" import datetime -from unittest.mock import patch import pytz from django.test.utils import override_settings @@ -88,7 +87,7 @@ def test_self_paced_due_date(self): __, sp_section = self.setup_course(display_name="Self-Paced Course", self_paced=True) assert sp_section.due is None - @patch.dict('lms.djangoapps.courseware.access.settings.FEATURES', {'DISABLE_START_DATES': False}) + @override_settings(DISABLE_START_DATES=False) def test_course_access_to_beta_users(self): """ Test that beta testers can access `self_paced` course prior to start date. @@ -116,7 +115,7 @@ def test_course_access_to_beta_users(self): assert has_access(beta_tester, 'load', self_paced_course) assert has_access(beta_tester, 'load', self_paced_section, self_paced_course.id) - @patch.dict('lms.djangoapps.courseware.access.settings.FEATURES', {'DISABLE_START_DATES': False}) + @override_settings(DISABLE_START_DATES=False) def test_instructor_paced_discussion_xblock_visibility(self): """ Verify that discussion xblocks scheduled for release in the future are @@ -129,7 +128,7 @@ def test_instructor_paced_discussion_xblock_visibility(self): xblocks = get_accessible_discussion_xblocks(course, self.non_staff_user) assert all((xblock.display_name == 'released') for xblock in xblocks) - @patch.dict('lms.djangoapps.courseware.access.settings.FEATURES', {'DISABLE_START_DATES': False}) + @override_settings(DISABLE_START_DATES=False) def test_self_paced_discussion_xblock_visibility(self): """ Regression test. Verify that discussion xblocks scheduled for release diff --git a/lms/djangoapps/courseware/tests/test_tabs.py b/lms/djangoapps/courseware/tests/test_tabs.py index 25f8a6e982d3..1f51ede61d5c 100644 --- a/lms/djangoapps/courseware/tests/test_tabs.py +++ b/lms/djangoapps/courseware/tests/test_tabs.py @@ -322,14 +322,14 @@ def setUp(self): self.xml_data = "static 463139" self.xml_url = "8e4cce2b4aaf4ba28b1220804619e41f" - @patch.dict('django.conf.settings.FEATURES', {'DISABLE_START_DATES': False}) + @override_settings(DISABLE_START_DATES=False) def test_logged_in_xml(self): self.setup_user() url = reverse('static_tab', args=[str(self.xml_course_key), self.xml_url]) resp = self.client.get(url) self.assertContains(resp, self.xml_data) - @patch.dict('django.conf.settings.FEATURES', {'DISABLE_START_DATES': False}) + @override_settings(DISABLE_START_DATES=False) def test_anonymous_user_xml(self): url = reverse('static_tab', args=[str(self.xml_course_key), self.xml_url]) resp = self.client.get(url) diff --git a/lms/djangoapps/courseware/tests/test_view_authentication.py b/lms/djangoapps/courseware/tests/test_view_authentication.py index e808d2e4027b..895e6ae0ced1 100644 --- a/lms/djangoapps/courseware/tests/test_view_authentication.py +++ b/lms/djangoapps/courseware/tests/test_view_authentication.py @@ -4,9 +4,9 @@ import datetime -from unittest.mock import patch import pytz +from django.test.utils import override_settings from django.urls import reverse from edx_toggles.toggles.testutils import override_waffle_flag @@ -387,7 +387,7 @@ def test_staff_method_legacy(self): # Test the _check_staff_legacy method which includes instructor dashboard checks self._check_staff_legacy(self.course) - @patch.dict('lms.djangoapps.courseware.access.settings.FEATURES', {'DISABLE_START_DATES': False}) + @override_settings(DISABLE_START_DATES=False) def test_dark_launch_enrolled_student(self): """ Make sure that before course start, students can't access course @@ -414,7 +414,7 @@ def test_dark_launch_enrolled_student(self): self._check_non_staff_light(self.test_course) self._check_non_staff_dark(self.test_course) - @patch.dict('lms.djangoapps.courseware.access.settings.FEATURES', {'DISABLE_START_DATES': False}) + @override_settings(DISABLE_START_DATES=False) def test_dark_launch_instructor(self): """ Make sure that before course start instructors can access the @@ -437,7 +437,7 @@ def test_dark_launch_instructor(self): self._check_non_staff_light(self.test_course) self._check_non_staff_dark(self.test_course) - @patch.dict('lms.djangoapps.courseware.access.settings.FEATURES', {'DISABLE_START_DATES': False}) + @override_settings(DISABLE_START_DATES=False) def test_dark_launch_global_staff(self): """ Make sure that before course start staff can access @@ -459,7 +459,7 @@ def test_dark_launch_global_staff(self): self._check_staff(self.course) self._check_staff(self.test_course) - @patch.dict('lms.djangoapps.courseware.access.settings.FEATURES', {'DISABLE_START_DATES': False}) + @override_settings(DISABLE_START_DATES=False) def test_enrollment_period(self): """ Check that enrollment periods work. @@ -495,7 +495,7 @@ def test_enrollment_period(self): assert self.enroll(self.course) @override_waffle_flag(LEGACY_INSTRUCTOR_DASHBOARD, active=True) - @patch.dict('lms.djangoapps.courseware.access.settings.FEATURES', {'DISABLE_START_DATES': False}) + @override_settings(DISABLE_START_DATES=False) def test_dark_launch_instructor_legacy(self): """ Make sure that before course start instructors can access the @@ -518,7 +518,7 @@ def test_dark_launch_instructor_legacy(self): self._check_non_staff_dark(self.test_course) @override_waffle_flag(LEGACY_INSTRUCTOR_DASHBOARD, active=True) - @patch.dict('lms.djangoapps.courseware.access.settings.FEATURES', {'DISABLE_START_DATES': False}) + @override_settings(DISABLE_START_DATES=False) def test_dark_launch_global_staff_legacy(self): """ Make sure that before course start staff can access @@ -558,7 +558,7 @@ def setUp(self): self.normal_student = UserFactory() self.beta_tester = BetaTesterFactory(course_key=self.course.id) # pylint: disable=no-member - @patch.dict('lms.djangoapps.courseware.access.settings.FEATURES', {'DISABLE_START_DATES': False}) + @override_settings(DISABLE_START_DATES=False) def test_course_beta_period(self): """ Check that beta-test access works for courses. @@ -567,7 +567,7 @@ def test_course_beta_period(self): self.assertCannotAccessCourse(self.normal_student, 'load', self.course) self.assertCanAccessCourse(self.beta_tester, 'load', self.course) - @patch.dict('lms.djangoapps.courseware.access.settings.FEATURES', {'DISABLE_START_DATES': False}) + @override_settings(DISABLE_START_DATES=False) def test_content_beta_period(self): """ Check that beta-test access works for content. diff --git a/lms/djangoapps/courseware/tests/test_views.py b/lms/djangoapps/courseware/tests/test_views.py index 85a6d21d3cbd..8a3d8b01062e 100644 --- a/lms/djangoapps/courseware/tests/test_views.py +++ b/lms/djangoapps/courseware/tests/test_views.py @@ -2696,7 +2696,8 @@ class AccessUtilsTestCase(ModuleStoreTestCase): }, ) @ddt.unpack - @patch.dict('django.conf.settings.FEATURES', {'DISABLE_START_DATES': False, 'ENABLE_ENTERPRISE_INTEGRATION': True}) + @override_settings(DISABLE_START_DATES=False) + @patch.dict('django.conf.settings.FEATURES', {'ENABLE_ENTERPRISE_INTEGRATION': True}) def test_is_course_open_for_learner( self, start_date_modifier, diff --git a/lms/djangoapps/courseware/testutils.py b/lms/djangoapps/courseware/testutils.py index f433ba06357a..31db986b202f 100644 --- a/lms/djangoapps/courseware/testutils.py +++ b/lms/djangoapps/courseware/testutils.py @@ -5,10 +5,10 @@ from abc import ABCMeta, abstractmethod from datetime import datetime, timedelta -from unittest.mock import patch from urllib.parse import urlencode import ddt +from django.test.utils import override_settings from common.djangoapps.course_modes.models import CourseMode from common.djangoapps.course_modes.tests.factories import CourseModeFactory @@ -206,7 +206,7 @@ def test_unenrolled_student(self): self.setup_user(admin=False, enroll=False, login=True) self.verify_response(expected_response_code=404) - @patch.dict('django.conf.settings.FEATURES', {'DISABLE_START_DATES': False}) + @override_settings(DISABLE_START_DATES=False) def test_fail_block_unreleased(self): self.setup_course() self.setup_user(admin=False, enroll=True, login=True) diff --git a/lms/djangoapps/discussion/rest_api/tests/test_api_v2.py b/lms/djangoapps/discussion/rest_api/tests/test_api_v2.py index aacf74d02984..69c5676100d3 100644 --- a/lms/djangoapps/discussion/rest_api/tests/test_api_v2.py +++ b/lms/djangoapps/discussion/rest_api/tests/test_api_v2.py @@ -4197,7 +4197,7 @@ def test_other_providers_ordering_error(self): ) -@mock.patch.dict("django.conf.settings.FEATURES", {"DISABLE_START_DATES": False}) +@override_settings(DISABLE_START_DATES=False) @override_settings(ENABLE_DISCUSSION_SERVICE=True) class GetCourseTopicsTest(ForumMockUtilsMixin, UrlResetMixin, ModuleStoreTestCase): """Test for get_course_topics""" diff --git a/lms/djangoapps/grades/rest_api/v1/tests/test_gradebook_views.py b/lms/djangoapps/grades/rest_api/v1/tests/test_gradebook_views.py index 9f1b4c478b57..485f87e6b5d7 100644 --- a/lms/djangoapps/grades/rest_api/v1/tests/test_gradebook_views.py +++ b/lms/djangoapps/grades/rest_api/v1/tests/test_gradebook_views.py @@ -11,6 +11,7 @@ import ddt import pytest +from django.test.utils import override_settings from django.urls import reverse from edx_toggles.toggles.testutils import override_waffle_flag from freezegun import freeze_time @@ -2222,7 +2223,7 @@ def test_with_unauthorized_user(self): assert status.HTTP_403_FORBIDDEN == resp.status_code - @patch.dict('django.conf.settings.FEATURES', {'DISABLE_START_DATES': False}) + @override_settings(DISABLE_START_DATES=False) def test_get_override_for_unreleased_block(self): self.login_course_staff() unreleased_subsection = BlockFactory.create( diff --git a/lms/djangoapps/grades/tests/test_course_data.py b/lms/djangoapps/grades/tests/test_course_data.py index 0068ba0318f0..592d29f8acb4 100644 --- a/lms/djangoapps/grades/tests/test_course_data.py +++ b/lms/djangoapps/grades/tests/test_course_data.py @@ -4,6 +4,7 @@ from unittest.mock import patch import pytest +from django.test.utils import override_settings from common.djangoapps.student.tests.factories import UserFactory from lms.djangoapps.course_blocks.api import get_course_blocks @@ -88,7 +89,7 @@ def test_no_data(self): with pytest.raises(ValueError): # noqa: PT011 _ = CourseData(self.user) - @patch.dict('django.conf.settings.FEATURES', {'DISABLE_START_DATES': False}) + @override_settings(DISABLE_START_DATES=False) def test_full_string(self): empty_structure = get_course_blocks(self.user, self.course.location) assert not empty_structure diff --git a/lms/djangoapps/instructor_task/tests/test_tasks_helper.py b/lms/djangoapps/instructor_task/tests/test_tasks_helper.py index 6a20da1ee434..7e988966b64c 100644 --- a/lms/djangoapps/instructor_task/tests/test_tasks_helper.py +++ b/lms/djangoapps/instructor_task/tests/test_tasks_helper.py @@ -1922,7 +1922,7 @@ def create_course(self): ) self.define_option_problem('Unreleased', parent=self.unreleased_section) - @patch.dict(settings.FEATURES, {'DISABLE_START_DATES': False}) + @override_settings(DISABLE_START_DATES=False) def test_grade_report(self): self.submit_student_answer(self.student.username, 'Problem1', ['Option 1']) diff --git a/lms/djangoapps/mobile_api/testutils.py b/lms/djangoapps/mobile_api/testutils.py index ab4a029a0fa5..ebf894a9d589 100644 --- a/lms/djangoapps/mobile_api/testutils.py +++ b/lms/djangoapps/mobile_api/testutils.py @@ -18,6 +18,7 @@ import ddt import pytz from django.conf import settings +from django.test.utils import override_settings from django.urls import reverse from django.utils import timezone from opaque_keys.edx.keys import CourseKey @@ -178,7 +179,8 @@ def test_course_not_found(self): response = self.api_response(expected_response_code=None, course_id=non_existent_course_id) self.verify_failure(response) # allow subclasses to override verification - @patch.dict('django.conf.settings.FEATURES', {'DISABLE_START_DATES': False, 'ENABLE_MKTG_SITE': True}) + @override_settings(DISABLE_START_DATES=False) + @patch.dict('django.conf.settings.FEATURES', {'ENABLE_MKTG_SITE': True}) def test_unreleased_course(self): # ensure the course always starts in the future self.course = CourseFactory.create(mobile_available=True, static_asset_path="needed_for_split") diff --git a/lms/djangoapps/mobile_api/users/tests.py b/lms/djangoapps/mobile_api/users/tests.py index 1599cf1007e2..cd2ecc26df89 100644 --- a/lms/djangoapps/mobile_api/users/tests.py +++ b/lms/djangoapps/mobile_api/users/tests.py @@ -168,9 +168,9 @@ def test_sort_order(self, api_version): str(courses[((num_courses - course_index) - 1)].id) @ddt.data(API_V05, API_V1, API_V2) + @override_settings(DISABLE_START_DATES=False) @patch.dict(settings.FEATURES, { 'ENABLE_PREREQUISITE_COURSES': True, - 'DISABLE_START_DATES': False, 'ENABLE_MKTG_SITE': True, }) def test_courseware_access(self, api_version): @@ -231,7 +231,8 @@ def test_courseware_access(self, api_version): ('default_start_date', None, None, "empty", API_V2), ) @ddt.unpack - @patch.dict(settings.FEATURES, {'DISABLE_START_DATES': False, 'ENABLE_MKTG_SITE': True}) + @override_settings(DISABLE_START_DATES=False) + @patch.dict(settings.FEATURES, {'ENABLE_MKTG_SITE': True}) def test_start_type_and_display(self, start, advertised_start, expected_display, expected_type, api_version): """ Tests that the correct start_type and start_display are returned in the diff --git a/openedx/core/djangoapps/course_groups/tests/test_partition_scheme.py b/openedx/core/djangoapps/course_groups/tests/test_partition_scheme.py index b2651ecb9401..36d49c371b0a 100644 --- a/openedx/core/djangoapps/course_groups/tests/test_partition_scheme.py +++ b/openedx/core/djangoapps/course_groups/tests/test_partition_scheme.py @@ -7,6 +7,7 @@ from unittest.mock import patch import django.test +from django.test.utils import override_settings from common.djangoapps.student.tests.factories import UserFactory from lms.djangoapps.courseware.tests.test_masquerade import StaffMasqueradeTestCase @@ -364,7 +365,7 @@ def _verify_masquerade_for_all_groups(self): self._verify_masquerade_for_group(None) @skip_unless_lms - @patch.dict('django.conf.settings.FEATURES', {'DISABLE_START_DATES': False}) + @override_settings(DISABLE_START_DATES=False) def test_group_masquerade(self): """ Tests that a staff member can masquerade as being in a particular group. @@ -372,7 +373,7 @@ def test_group_masquerade(self): self._verify_masquerade_for_all_groups() @skip_unless_lms - @patch.dict('django.conf.settings.FEATURES', {'DISABLE_START_DATES': False}) + @override_settings(DISABLE_START_DATES=False) def test_group_masquerade_with_cohort(self): """ Tests that a staff member can masquerade as being in a particular group