From 75f17ecc8ebc663fab2e2208ad27945c8f6f952f Mon Sep 17 00:00:00 2001 From: Saleem Latif Date: Wed, 10 Feb 2016 13:48:07 +0500 Subject: [PATCH] correct FAVICON_PATH setting for comprehensive theming --- .../tests/test_comprehensive_theming.py | 15 +++++++++++++++ openedx/core/djangoapps/theming/core.py | 4 ---- themes/red-theme/lms/static/images/favicon.ico | Bin 0 -> 1406 bytes 3 files changed, 15 insertions(+), 4 deletions(-) create mode 100644 themes/red-theme/lms/static/images/favicon.ico diff --git a/lms/djangoapps/courseware/tests/test_comprehensive_theming.py b/lms/djangoapps/courseware/tests/test_comprehensive_theming.py index ec734fec1dd1..752eb8103010 100644 --- a/lms/djangoapps/courseware/tests/test_comprehensive_theming.py +++ b/lms/djangoapps/courseware/tests/test_comprehensive_theming.py @@ -71,3 +71,18 @@ def test_default_logo_image(self): 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 ee3e85410365..9203cc5c1f4b 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 0000000000000000000000000000000000000000..5e784977e6745eac7f72629b34e45c5bd6a79bd7 GIT binary patch literal 1406 zcmZQzU<5(|0R}M0U}azs1F|%L7$l?s#Ec9aKoZP=&`4}m)x!v}QPyY(jE2C73IRqi z0C^e00+Fx)fQrDlP$dX1SOA#|5