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
2f4fb305
Commit
2f4fb305
authored
Sep 02, 2014
by
Stephen Sanchez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cleaning up ddt syntax for new footer test.
parent
75d6f99f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
16 deletions
+16
-16
common/djangoapps/edxmako/tests.py
+2
-2
lms/djangoapps/courseware/tests/test_footer.py
+14
-14
No files found.
common/djangoapps/edxmako/tests.py
View file @
2f4fb305
...
...
@@ -51,9 +51,9 @@ class ShortcutsTests(UrlResetMixin, TestCase):
self
.
assertEquals
(
footer_setting
,
result
.
get
(
'ENABLE_NEW_EDX_FOOTER'
))
self
.
assertEquals
(
header_setting
,
result
.
get
(
'ENABLE_NEW_EDX_HEADER'
))
@ddt.data
(
True
,
False
)
@ddt.data
(
(
True
,
None
),
(
False
,
None
)
)
@ddt.unpack
def
test_edx_footer
(
self
,
expected_result
):
def
test_edx_footer
(
self
,
expected_result
,
_
):
with
patch
.
dict
(
'django.conf.settings.FEATURES'
,
{
'IS_EDX_DOMAIN'
:
expected_result
}):
...
...
lms/djangoapps/courseware/tests/test_footer.py
View file @
2f4fb305
...
...
@@ -3,35 +3,35 @@ Tests related to the basic footer-switching based off SITE_NAME to ensure
edx.org uses an edx footer but other instances use an Open edX footer.
"""
from
mock
import
patch
from
django.test
import
TestCase
from
django.test.utils
import
override_settings
class
TestFooter
(
TestCase
):
@override_settings
(
SITE_NAME
=
"edx.org"
)
def
test_edx_footer
(
self
):
"""
Verify that the homepage, when accessed at edx.org, has the edX footer
"""
with
patch
.
dict
(
'django.conf.settings.FEATURES'
,
{
"IS_EDX_DOMAIN"
:
True
}):
resp
=
self
.
client
.
get
(
'/'
)
self
.
assertEqual
(
resp
.
status_code
,
200
)
resp
=
self
.
client
.
get
(
'/'
)
self
.
assertEqual
(
resp
.
status_code
,
200
)
# assert that footer template has been properly overridden on homepage
# test the top-level element class; which is less likely to change than copy.
self
.
assertContains
(
resp
,
'edx-footer'
)
# assert that footer template has been properly overridden on homepage
# test the top-level element class; which is less likely to change than copy.
self
.
assertContains
(
resp
,
'edx-footer'
)
@override_settings
(
SITE_NAME
=
"example.com"
)
def
test_openedx_footer
(
self
):
"""
Verify that the homepage, when accessed at something other than
edx.org, has the Open edX footer
"""
with
patch
.
dict
(
'django.conf.settings.FEATURES'
,
{
"IS_EDX_DOMAIN"
:
False
}):
resp
=
self
.
client
.
get
(
'/'
)
self
.
assertEqual
(
resp
.
status_code
,
200
)
resp
=
self
.
client
.
get
(
'/'
)
self
.
assertEqual
(
resp
.
status_code
,
200
)
# assert that footer template has been properly overridden on homepage
# test the top-level element class; which is less likely to change than copy.
self
.
assertContains
(
resp
,
'wrapper-footer'
)
# assert that footer template has been properly overridden on homepage
# test the top-level element class; which is less likely to change than copy.
self
.
assertContains
(
resp
,
'wrapper-footer'
)
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