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
c8fdf6ad
Commit
c8fdf6ad
authored
Aug 15, 2013
by
Diana Huang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add in tests for the marketing site button.
parent
6db1f6a6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
0 deletions
+32
-0
lms/djangoapps/courseware/tests/test_views.py
+32
-0
No files found.
lms/djangoapps/courseware/tests/test_views.py
View file @
c8fdf6ad
...
...
@@ -12,12 +12,14 @@ from django.core.urlresolvers import reverse
from
student.models
import
CourseEnrollment
from
student.tests.factories
import
AdminFactory
from
xmodule.modulestore.django
import
modulestore
import
courseware.views
as
views
from
xmodule.modulestore
import
Location
from
pytz
import
UTC
from
modulestore_config
import
TEST_DATA_XML_MODULESTORE
from
course_modes.models
import
CourseMode
class
Stub
():
...
...
@@ -164,6 +166,36 @@ class ViewsTestCase(TestCase):
# generate/store a real password.
self
.
assertEquals
(
chat_settings
[
'password'
],
"johndoe@
%
s"
%
domain
)
def
test_course_mktg_about_coming_soon
(
self
):
# we should not be able to find this course
url
=
reverse
(
'mktg_about_course'
,
kwargs
=
{
'course_id'
:
'no/course/here'
})
response
=
self
.
client
.
get
(
url
)
self
.
assertIn
(
'Coming Soon'
,
response
.
content
)
def
test_course_mktg_register
(
self
):
admin
=
AdminFactory
()
self
.
client
.
login
(
username
=
admin
.
username
,
password
=
'test'
)
url
=
reverse
(
'mktg_about_course'
,
kwargs
=
{
'course_id'
:
self
.
course_id
})
response
=
self
.
client
.
get
(
url
)
self
.
assertIn
(
'Register for'
,
response
.
content
)
self
.
assertNotIn
(
'and choose your student track'
,
response
.
content
)
def
test_course_mktg_register_multiple_modes
(
self
):
admin
=
AdminFactory
()
CourseMode
.
objects
.
get_or_create
(
mode_slug
=
'honor'
,
mode_display_name
=
'Honor Code Certificate'
,
course_id
=
self
.
course_id
)
CourseMode
.
objects
.
get_or_create
(
mode_slug
=
'verified'
,
mode_display_name
=
'Verified Certificate'
,
course_id
=
self
.
course_id
)
self
.
client
.
login
(
username
=
admin
.
username
,
password
=
'test'
)
url
=
reverse
(
'mktg_about_course'
,
kwargs
=
{
'course_id'
:
self
.
course_id
})
response
=
self
.
client
.
get
(
url
)
self
.
assertIn
(
'Register for'
,
response
.
content
)
self
.
assertIn
(
'and choose your student track'
,
response
.
content
)
# clean up course modes
CourseMode
.
objects
.
all
()
.
delete
()
def
test_submission_history_xss
(
self
):
# log into a staff account
admin
=
AdminFactory
()
...
...
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