Skip to content

Commit b448b0f

Browse files
committed
fix: look up ENABLE_CATALOG_MICROFRONTEND in settings directly, adjust tests
1 parent 94c00af commit b448b0f

9 files changed

Lines changed: 4 additions & 18 deletions

File tree

cms/djangoapps/contentstore/rest_api/v1/views/tests/test_settings.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717

1818

1919
@ddt.ddt
20-
@patch.dict("django.conf.settings.FEATURES", {"ENABLE_CATALOG_MICROFRONTEND": False})
2120
class CourseSettingsViewTest(CourseTestCase, PermissionAccessMixin):
2221
"""
2322
Tests for CourseSettingsView.

cms/djangoapps/contentstore/tests/test_contentstore.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,6 @@ def decorated_func(*args, **kwargs):
9191

9292

9393
@override_settings(CONTENTSTORE=TEST_DATA_CONTENTSTORE)
94-
@mock.patch.dict("django.conf.settings.FEATURES", {"ENABLE_CATALOG_MICROFRONTEND": False})
9594
class ContentStoreTestCase(CourseTestCase):
9695
"""
9796
Base class for Content Store Test Cases
@@ -1050,7 +1049,6 @@ def _check_verticals(self, locations):
10501049

10511050

10521051
@ddt.ddt
1053-
@mock.patch.dict("django.conf.settings.FEATURES", {"ENABLE_CATALOG_MICROFRONTEND": False})
10541052
class ContentStoreTest(ContentStoreTestCase):
10551053
"""
10561054
Tests for the CMS ContentStore application.

cms/djangoapps/contentstore/tests/test_course_settings.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,6 @@ def test_disable_advanced_settings_feature(self, disable_advanced_settings):
182182

183183
with override_settings(FEATURES={
184184
'DISABLE_ADVANCED_SETTINGS': disable_advanced_settings,
185-
'ENABLE_CATALOG_MICROFRONTEND': False,
186185
}):
187186
for handler in (
188187
'import_handler',
@@ -222,7 +221,6 @@ def test_disable_advanced_settings_feature(self, disable_advanced_settings):
222221

223222

224223
@ddt.ddt
225-
@patch.dict("django.conf.settings.FEATURES", {"ENABLE_CATALOG_MICROFRONTEND": False})
226224
class CourseDetailsViewTest(CourseTestCase, MilestonesTestCaseMixin):
227225
"""
228226
Tests for modifying content on the first course settings page (course dates, overview, etc.).
@@ -1927,7 +1925,6 @@ def test_add(self):
19271925
self.assertEqual(len(self.starting_graders) + 1, len(current_graders))
19281926

19291927

1930-
@patch.dict("django.conf.settings.FEATURES", {"ENABLE_CATALOG_MICROFRONTEND": False})
19311928
class CourseEnrollmentEndFieldTest(CourseTestCase):
19321929
"""
19331930
Base class to test the enrollment end fields in the course settings details view in Studio

cms/djangoapps/contentstore/views/tests/test_credit_eligibility.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
from xmodule.modulestore.tests.factories import CourseFactory # lint-amnesty, pylint: disable=wrong-import-order
1616

1717

18-
@mock.patch.dict("django.conf.settings.FEATURES", {"ENABLE_CATALOG_MICROFRONTEND": False})
1918
class CreditEligibilityTest(CourseTestCase):
2019
"""
2120
Base class to test the course settings details view in Studio for credit

cms/djangoapps/contentstore/views/tests/test_exam_settings_view.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
@override_waffle_flag(toggles.LEGACY_STUDIO_CONFIGURATIONS, True)
3131
@override_waffle_flag(toggles.LEGACY_STUDIO_GRADING, True)
3232
@override_waffle_flag(toggles.LEGACY_STUDIO_ADVANCED_SETTINGS, True)
33-
@patch.dict("django.conf.settings.FEATURES", {"ENABLE_CATALOG_MICROFRONTEND": False})
3433
class TestExamSettingsView(CourseTestCase, UrlResetMixin):
3534
"""
3635
Unit tests for the exam settings view.

common/djangoapps/student/tests/test_views.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,6 @@ class StudentDashboardTests(SharedModuleStoreTestCase, MilestonesTestCaseMixin,
191191
'DISABLE_START_DATES': False,
192192
'ENABLE_MKTG_SITE': True,
193193
'DISABLE_SET_JWT_COOKIES_FOR_TESTS': True,
194-
'ENABLE_CATALOG_MICROFRONTEND': False,
195194
},
196195
'SOCIAL_SHARING_SETTINGS': {
197196
'CUSTOM_COURSE_URLS': True,

common/djangoapps/util/tests/test_course.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -146,8 +146,6 @@ def test_sharing_link_with_new_course_about_page(
146146
"""
147147
Verify the method gives correct course sharing url when new course about page is used.
148148
"""
149-
features = settings.FEATURES.copy()
150-
features['ENABLE_CATALOG_MICROFRONTEND'] = catalog_mfe_enabled
151-
with override_settings(FEATURES=features):
149+
with override_settings(ENABLE_CATALOG_MICROFRONTEND=catalog_mfe_enabled):
152150
actual_course_sharing_link = get_link_for_about_page(self.course_overview)
153151
assert actual_course_sharing_link == expected_course_sharing_link

lms/djangoapps/branding/toggles.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@ def use_catalog_mfe():
1111
Returns a boolean = true if the Catalog MFE is enabled.
1212
"""
1313
return configuration_helpers.get_value(
14-
'ENABLE_CATALOG_MICROFRONTEND', settings.FEATURES.get('ENABLE_CATALOG_MICROFRONTEND')
14+
'ENABLE_CATALOG_MICROFRONTEND', settings.ENABLE_CATALOG_MICROFRONTEND
1515
)

lms/djangoapps/learner_home/test_views.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -98,11 +98,8 @@ def test_link_with_new_catalog_page(self, catalog_mfe_enabled, expected_catalog_
9898
"""
9999
Test that the catalog link is constructed correctly based on the MFE flags.
100100
"""
101-
features = settings.FEATURES.copy()
102-
features['ENABLE_CATALOG_MICROFRONTEND'] = catalog_mfe_enabled
103-
with override_settings(FEATURES=features):
104-
actual_course_sharing_link = get_platform_settings()["courseSearchUrl"]
105-
assert actual_course_sharing_link == expected_catalog_link
101+
with override_settings(ENABLE_CATALOG_MICROFRONTEND=catalog_mfe_enabled):
102+
assert get_platform_settings()["courseSearchUrl"] == expected_catalog_link
106103

107104

108105
@ddt.ddt

0 commit comments

Comments
 (0)