refactor: simplify tests a bit & add DEFAULT_ADVANCED_MODULES to test settings

This commit is contained in:
Andrii
2025-04-22 11:59:05 +03:00
parent d5c50b5376
commit 94c37e9449
2 changed files with 12 additions and 3 deletions

View File

@@ -2969,9 +2969,8 @@ class TestComponentTemplates(CourseTestCase):
# Check for default advanced modules
advanced_templates = self.get_templates_of_type("advanced")
self.assertEqual(len(advanced_templates), len(settings.DEFAULT_ADVANCED_MODULES))
advanced_module_titles = [t['display_name'] for t in advanced_templates]
self.assertEqual(advanced_module_titles, self.default_advanced_modules_titles)
advanced_module_keys = [t['category'] for t in advanced_templates]
self.assertCountEqual(advanced_module_keys, settings.DEFAULT_ADVANCED_MODULES)
# Now fully disable video through XBlockConfiguration
XBlockConfiguration.objects.create(name="video", enabled=False)

View File

@@ -336,3 +336,13 @@ COURSE_LIVE_GLOBAL_CREDENTIALS["BIG_BLUE_BUTTON"] = {
OPENEDX_LEARNING = {
"MEDIA": {"BACKEND": "django.core.files.storage.InMemoryStorage", "OPTIONS": {"location": MEDIA_ROOT + "_private"}}
}
DEFAULT_ADVANCED_MODULES = [
'google-calendar',
'google-document',
'lti_consumer',
'poll',
'split_test',
'survey',
'word_cloud',
]