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
f930060a
Commit
f930060a
authored
Mar 15, 2017
by
Diana Huang
Committed by
Brian Jacobel
Mar 23, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Test course resume functionality.
parent
a4c77054
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
1 deletions
+8
-1
openedx/features/course_experience/tests/views/test_course_outline.py
+8
-1
No files found.
openedx/features/course_experience/tests/views/test_course_outline.py
View file @
f930060a
"""
Tests for the Course Outline view and supporting views.
"""
from
mock
import
patch
from
django.core.urlresolvers
import
reverse
from
student.models
import
CourseEnrollment
...
...
@@ -26,6 +27,7 @@ class TestCourseOutlinePage(SharedModuleStoreTestCase):
chapter
=
ItemFactory
.
create
(
category
=
'chapter'
,
parent_location
=
course
.
location
)
section
=
ItemFactory
.
create
(
category
=
'sequential'
,
parent_location
=
chapter
.
location
)
ItemFactory
.
create
(
category
=
'vertical'
,
parent_location
=
section
.
location
)
course
.
last_accessed
=
section
.
url_name
cls
.
courses
.
append
(
course
)
...
...
@@ -36,6 +38,7 @@ class TestCourseOutlinePage(SharedModuleStoreTestCase):
section2
=
ItemFactory
.
create
(
category
=
'sequential'
,
parent_location
=
chapter
.
location
)
ItemFactory
.
create
(
category
=
'vertical'
,
parent_location
=
section
.
location
)
ItemFactory
.
create
(
category
=
'vertical'
,
parent_location
=
section2
.
location
)
course
.
last_accessed
=
None
@classmethod
def
setUpTestData
(
cls
):
...
...
@@ -52,8 +55,10 @@ class TestCourseOutlinePage(SharedModuleStoreTestCase):
super
(
TestCourseOutlinePage
,
self
)
.
setUp
()
self
.
client
.
login
(
username
=
self
.
user
.
username
,
password
=
self
.
password
)
def
test_render
(
self
):
@patch
(
'openedx.features.course_experience.views.course_outline.get_last_accessed_courseware'
)
def
test_render
(
self
,
patched_get_last_accessed
):
for
course
in
self
.
courses
:
patched_get_last_accessed
.
return_value
=
(
None
,
course
.
last_accessed
)
url
=
reverse
(
'edx.course_experience.course_home'
,
kwargs
=
{
...
...
@@ -64,6 +69,8 @@ class TestCourseOutlinePage(SharedModuleStoreTestCase):
self
.
assertEqual
(
response
.
status_code
,
200
)
response_content
=
response
.
content
.
decode
(
"utf-8"
)
if
course
.
last_accessed
is
not
None
:
self
.
assertIn
(
'Resume Course'
,
response_content
)
for
chapter
in
course
.
children
:
self
.
assertIn
(
chapter
.
display_name
,
response_content
)
for
section
in
chapter
.
children
:
...
...
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