Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
5ccc80b4
Commit
5ccc80b4
authored
Jul 03, 2016
by
Saleem Latif
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix footer test failures
parent
69410948
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
8 additions
and
12 deletions
+8
-12
lms/djangoapps/courseware/tests/test_comprehensive_theming.py
+3
-0
openedx/core/djangoapps/theming/helpers.py
+2
-0
openedx/core/djangoapps/theming/tests/test_theme_style_overrides.py
+3
-6
openedx/core/djangoapps/theming/tests/test_util.py
+0
-6
No files found.
lms/djangoapps/courseware/tests/test_comprehensive_theming.py
View file @
5ccc80b4
...
...
@@ -6,6 +6,7 @@ from django.test import TestCase
from
path
import
path
# pylint: disable=no-name-in-module
from
django.contrib
import
staticfiles
import
edxmako
from
openedx.core.djangoapps.theming.tests.test_util
import
with_comprehensive_theme
from
openedx.core.lib.tempdir
import
mkdtemp_clean
,
create_symlink
,
delete_symlink
...
...
@@ -49,6 +50,8 @@ class TestComprehensiveTheming(TestCase):
dest_path
=
path
(
settings
.
COMPREHENSIVE_THEME_DIRS
[
0
])
/
tmp_theme
create_symlink
(
themes_dir
/
tmp_theme
,
dest_path
)
edxmako
.
paths
.
add_lookup
(
'main'
,
themes_dir
,
prepend
=
True
)
@with_comprehensive_theme
(
tmp_theme
)
def
do_the_test
(
self
):
"""A function to do the work so we can use the decorator."""
...
...
openedx/core/djangoapps/theming/helpers.py
View file @
5ccc80b4
...
...
@@ -106,6 +106,8 @@ def get_template_path_with_theme(relative_path):
Returns:
(str): template path in current site's theme
"""
relative_path
=
os
.
path
.
normpath
(
relative_path
)
theme
=
get_current_theme
()
if
not
theme
:
...
...
openedx/core/djangoapps/theming/tests/test_theme_style_overrides.py
View file @
5ccc80b4
...
...
@@ -25,8 +25,7 @@ class TestComprehensiveThemeLMS(TestCase):
# Clear the internal staticfiles caches, to get test isolation.
staticfiles
.
finders
.
get_finder
.
cache_clear
()
@override_settings
(
COMPREHENSIVE_THEME_DIRS
=
[
settings
.
TEST_THEME
.
dirname
()])
@with_comprehensive_theme
(
settings
.
TEST_THEME
.
basename
())
@with_comprehensive_theme
(
"test-theme"
)
def
test_footer
(
self
):
"""
Test that theme footer is used instead of default footer.
...
...
@@ -36,8 +35,7 @@ class TestComprehensiveThemeLMS(TestCase):
# This string comes from header.html of test-theme
self
.
assertContains
(
resp
,
"This is a footer for test-theme."
)
@override_settings
(
COMPREHENSIVE_THEME_DIRS
=
[
settings
.
TEST_THEME
.
dirname
()])
@with_comprehensive_theme
(
settings
.
TEST_THEME
.
basename
())
@with_comprehensive_theme
(
"test-theme"
)
def
test_logo_image
(
self
):
"""
Test that theme logo is used instead of default logo.
...
...
@@ -61,8 +59,7 @@ class TestComprehensiveThemeCMS(TestCase):
# Clear the internal staticfiles caches, to get test isolation.
staticfiles
.
finders
.
get_finder
.
cache_clear
()
@override_settings
(
COMPREHENSIVE_THEME_DIRS
=
[
settings
.
TEST_THEME
.
dirname
()])
@with_comprehensive_theme
(
settings
.
TEST_THEME
.
basename
())
@with_comprehensive_theme
(
"test-theme"
)
def
test_template_override
(
self
):
"""
Test that theme templates are used instead of default templates.
...
...
openedx/core/djangoapps/theming/tests/test_util.py
View file @
5ccc80b4
...
...
@@ -32,9 +32,6 @@ def with_comprehensive_theme(theme_dir_name):
site
,
__
=
Site
.
objects
.
get_or_create
(
domain
=
domain
,
name
=
domain
)
site_theme
,
__
=
SiteTheme
.
objects
.
get_or_create
(
site
=
site
,
theme_dir_name
=
theme_dir_name
)
for
_dir
in
settings
.
COMPREHENSIVE_THEME_DIRS
:
edxmako
.
paths
.
add_lookup
(
'main'
,
_dir
,
prepend
=
True
)
with
patch
(
'openedx.core.djangoapps.theming.helpers.get_current_site_theme'
,
return_value
=
site_theme
):
with
patch
(
'openedx.core.djangoapps.theming.helpers.get_current_site'
,
return_value
=
site
):
...
...
@@ -57,9 +54,6 @@ def with_comprehensive_theme_context(theme=None):
site
,
__
=
Site
.
objects
.
get_or_create
(
domain
=
domain
,
name
=
theme
)
site_theme
,
__
=
SiteTheme
.
objects
.
get_or_create
(
site
=
site
,
theme_dir_name
=
theme
)
for
_dir
in
settings
.
COMPREHENSIVE_THEME_DIRS
:
edxmako
.
paths
.
add_lookup
(
'main'
,
_dir
,
prepend
=
True
)
with
patch
(
'openedx.core.djangoapps.theming.helpers.get_current_site_theme'
,
return_value
=
site_theme
):
with
patch
(
'openedx.core.djangoapps.theming.helpers.get_current_site'
,
return_value
=
site
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment