Skip to content

Commit

Permalink
Merge pull request #11494 from edx/saleem-latif/WL-307
Browse files Browse the repository at this point in the history
WL-307: correct FAVICON_PATH setting for comprehensive theming
  • Loading branch information
saleem-latif committed Feb 16, 2016
2 parents 8280e22 + 75f17ec commit cd101d5
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 deletions.
15 changes: 15 additions & 0 deletions lms/djangoapps/courseware/tests/test_comprehensive_theming.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')
4 changes: 0 additions & 4 deletions openedx/core/djangoapps/theming/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down
Binary file added themes/red-theme/lms/static/images/favicon.ico
Binary file not shown.

0 comments on commit cd101d5

Please sign in to comment.