Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WL-307: correct FAVICON_PATH setting for comprehensive theming #11494

Merged
merged 1 commit into from
Feb 16, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.