test: use ENABLE_CATALOG_MICROFRONTEND from settings

This commit is contained in:
Serhii Nanai
2025-09-30 10:07:40 +03:00
parent 7b127a4885
commit 6c31268a9d
2 changed files with 3 additions and 17 deletions

View File

@@ -298,13 +298,8 @@ class TestIndex(SiteMixin, TestCase):
@ddt.unpack
def test_index_redirects_to_mfe(self, catalog_mfe_enabled, expected_redirect):
"""Test that index view redirects to MFE when both flags are enabled."""
old_features = settings.FEATURES.copy()
old_features.update({
"ENABLE_CATALOG_MICROFRONTEND": catalog_mfe_enabled,
"COURSES_ARE_BROWSABLE": True,
})
new_settings = {
"FEATURES": old_features,
"ENABLE_CATALOG_MICROFRONTEND": catalog_mfe_enabled,
"CATALOG_MICROFRONTEND_URL": "http://example.com/catalog",
}
with override_settings(**new_settings):
@@ -339,13 +334,8 @@ class TestCourses(SiteMixin, TestCase):
@ddt.unpack
def test_courses_redirect_to_mfe(self, catalog_mfe_enabled, expected_redirect):
"""Test that courses view redirects to MFE when both flags are enabled"""
old_features = settings.FEATURES.copy()
old_features.update({
"ENABLE_CATALOG_MICROFRONTEND": catalog_mfe_enabled,
"COURSES_ARE_BROWSABLE": True,
})
new_settings = {
"FEATURES": old_features,
"ENABLE_CATALOG_MICROFRONTEND": catalog_mfe_enabled,
"CATALOG_MICROFRONTEND_URL": "http://example.com/catalog",
}
with override_settings(**new_settings):

View File

@@ -3410,12 +3410,8 @@ class CourseAboutViewTests(ModuleStoreTestCase):
"""
Test that the CourseAboutView redirects to the MFE when appropriate.
"""
old_features = settings.FEATURES.copy()
old_features.update({
"ENABLE_CATALOG_MICROFRONTEND": catalog_mfe_enabled,
})
new_settings = {
"FEATURES": old_features,
"ENABLE_CATALOG_MICROFRONTEND": catalog_mfe_enabled,
"CATALOG_MICROFRONTEND_URL": "http://example.com/catalog",
}
with override_settings(**new_settings):