Merge pull request #11494 from edx/saleem-latif/WL-307

WL-307: correct FAVICON_PATH setting for comprehensive theming
This commit is contained in:
Saleem Latif
2016-02-16 14:39:13 +05:00
3 changed files with 15 additions and 4 deletions

View File

@@ -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')

View File

@@ -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

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB