diff --git a/lms/djangoapps/courseware/tests/test_comprehensive_theming.py b/lms/djangoapps/courseware/tests/test_comprehensive_theming.py index ec734fec1d..752eb81030 100644 --- a/lms/djangoapps/courseware/tests/test_comprehensive_theming.py +++ b/lms/djangoapps/courseware/tests/test_comprehensive_theming.py @@ -71,3 +71,18 @@ class TestComprehensiveTheming(TestCase): def test_overridden_logo_image(self): result = staticfiles.finders.find('images/logo.png') self.assertEqual(result, settings.REPO_ROOT / 'themes/red-theme/lms/static/images/logo.png') + + def test_default_favicon(self): + """ + Test default favicon is served if no theme is applied + """ + result = staticfiles.finders.find('images/favicon.ico') + self.assertEqual(result, settings.REPO_ROOT / 'lms/static/images/favicon.ico') + + @with_comprehensive_theme(settings.REPO_ROOT / 'themes/red-theme') + def test_overridden_favicon(self): + """ + Test comprehensive theme override on favicon image. + """ + result = staticfiles.finders.find('images/favicon.ico') + self.assertEqual(result, settings.REPO_ROOT / 'themes/red-theme/lms/static/images/favicon.ico') diff --git a/openedx/core/djangoapps/theming/core.py b/openedx/core/djangoapps/theming/core.py index ee3e854103..9203cc5c1f 100644 --- a/openedx/core/djangoapps/theming/core.py +++ b/openedx/core/djangoapps/theming/core.py @@ -45,10 +45,6 @@ def comprehensive_theme_changes(theme_dir): if locale_dir.isdir(): changes['settings']['LOCALE_PATHS'] = [locale_dir] + settings.LOCALE_PATHS - favicon = component_dir / "static" / "images" / "favicon.ico" - if favicon.isfile(): - changes['settings']['FAVICON_PATH'] = str(favicon) - return changes diff --git a/themes/red-theme/lms/static/images/favicon.ico b/themes/red-theme/lms/static/images/favicon.ico new file mode 100644 index 0000000000..5e784977e6 Binary files /dev/null and b/themes/red-theme/lms/static/images/favicon.ico differ