From 141a04e71249bdc66e279511a536d81bfb624547 Mon Sep 17 00:00:00 2001 From: Feanil Patel Date: Mon, 24 Aug 2026 11:16:28 -0400 Subject: [PATCH 1/2] refactor: migrate DISABLE_SET_JWT_COOKIES_FOR_TESTS test override off FEATURES-as-dict StudentDashboardTests applies MOCK_SETTINGS / MOCK_SETTINGS_HIDE_COURSES via @patch.multiple('django.conf.settings', ...), each nesting DISABLE_SET_JWT_COOKIES_FOR_TESTS inside a 'FEATURES' sub-dict. The production reader (openedx/core/djangoapps/user_authn/ cookies.py) reads the flat settings.DISABLE_SET_JWT_COOKIES_FOR_TESTS, so move the key to the top level of both mock dicts (matching the DISABLE_START_DATES entry already there) and drop the now-empty FEATURES sub-dicts. Co-Authored-By: Claude Opus 4.8 --- common/djangoapps/student/tests/test_views.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/common/djangoapps/student/tests/test_views.py b/common/djangoapps/student/tests/test_views.py index fe45aa08d7a3..34439a3fbbaa 100644 --- a/common/djangoapps/student/tests/test_views.py +++ b/common/djangoapps/student/tests/test_views.py @@ -193,9 +193,7 @@ class StudentDashboardTests(SharedModuleStoreTestCase, MilestonesTestCaseMixin, ENABLED_SIGNALS = ['course_published'] MOCK_SETTINGS = { 'DISABLE_START_DATES': False, - 'FEATURES': { - 'DISABLE_SET_JWT_COOKIES_FOR_TESTS': True, - }, + 'DISABLE_SET_JWT_COOKIES_FOR_TESTS': True, 'SOCIAL_SHARING_SETTINGS': { 'CUSTOM_COURSE_URLS': True, 'DASHBOARD_FACEBOOK': True, @@ -203,9 +201,7 @@ class StudentDashboardTests(SharedModuleStoreTestCase, MilestonesTestCaseMixin, }, } MOCK_SETTINGS_HIDE_COURSES = { - 'FEATURES': { - 'DISABLE_SET_JWT_COOKIES_FOR_TESTS': True, - } + 'DISABLE_SET_JWT_COOKIES_FOR_TESTS': True, } def setUp(self): From 41019d2634417ecd9ad3602647bdb81505967135 Mon Sep 17 00:00:00 2001 From: Feanil Patel Date: Mon, 24 Aug 2026 11:16:28 -0400 Subject: [PATCH 2/2] refactor: migrate mfe_config precedence test off FEATURES-as-dict test_config_order_of_precedence overrode FEATURES={ENABLE_COURSE_SORTING_BY_START_DATE: True, ENABLE_COURSE_DISCOVERY: True} as a "settings FEATURES" layer, but the mfe_config view reads those flags as flat settings (get_legacy_config reads settings.ENABLE_COURSE_SORTING_BY_START_DATE and settings.ENABLE_COURSE_DISCOVERY), so the FEATURES override never reached the view. Set them as flat override_settings -- the plain-settings layer the test intends. No assertion depends on ENABLE_COURSE_DISCOVERY, and the ENABLE_COURSE_SORTING_BY_START_DATE assertion still holds because MFE_CONFIG takes precedence over plain settings. Co-Authored-By: Claude Opus 4.8 --- lms/djangoapps/mfe_config_api/tests/test_views.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/lms/djangoapps/mfe_config_api/tests/test_views.py b/lms/djangoapps/mfe_config_api/tests/test_views.py index 8b508544acc8..4da53c8fc656 100644 --- a/lms/djangoapps/mfe_config_api/tests/test_views.py +++ b/lms/djangoapps/mfe_config_api/tests/test_views.py @@ -277,11 +277,10 @@ def side_effect(key, default=None): configuration_helpers_mock.get_value.side_effect = side_effect with override_settings( - HOMEPAGE_COURSE_MAX=3, # Plain settings (lowest precedence) - FEATURES={ # Settings FEATURES - "ENABLE_COURSE_SORTING_BY_START_DATE": True, - "ENABLE_COURSE_DISCOVERY": True, - } + # Plain settings (lowest precedence) + HOMEPAGE_COURSE_MAX=3, + ENABLE_COURSE_SORTING_BY_START_DATE=True, + ENABLE_COURSE_DISCOVERY=True, ): response = self.client.get(f"{self.mfe_config_api_url}?mfe=catalog")