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
2b80b358
Commit
2b80b358
authored
May 16, 2013
by
Diana Huang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add in a test for the marketing_link function in mitxmako
parent
b6c00810
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
0 deletions
+26
-0
common/djangoapps/mitxmako/tests.py
+26
-0
No files found.
common/djangoapps/mitxmako/tests.py
0 → 100644
View file @
2b80b358
from
django.test
import
TestCase
from
django.test.utils
import
override_settings
from
django.core.urlresolvers
import
reverse
from
django.conf
import
settings
from
mitxmako.shortcuts
import
marketing_link
from
mock
import
patch
class
ShortcutsTests
(
TestCase
):
"""
Test the mitxmako shortcuts file
"""
@override_settings
(
MKTG_URLS
=
{
'ROOT'
:
'dummy-root'
,
'ABOUT'
:
'/about-us'
})
@override_settings
(
MKTG_URL_LINK_MAP
=
{
'ABOUT'
:
'about_edx'
})
def
test_marketing_link
(
self
):
# test marketing site on
with
patch
.
dict
(
'django.conf.settings.MITX_FEATURES'
,
{
'ENABLE_MKTG_SITE'
:
True
}):
expected_link
=
'dummy-root/about-us'
link
=
marketing_link
(
'ABOUT'
)
self
.
assertEquals
(
link
,
expected_link
)
# test marketing site off
with
patch
.
dict
(
'django.conf.settings.MITX_FEATURES'
,
{
'ENABLE_MKTG_SITE'
:
False
}):
expected_link
=
reverse
(
'about_edx'
)
link
=
marketing_link
(
'ABOUT'
)
self
.
assertEquals
(
link
,
expected_link
)
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