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
bfeeeff7
Commit
bfeeeff7
authored
Jan 23, 2017
by
Mushtaq Ali
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix format parameter and test
parent
1b011af7
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
7 deletions
+5
-7
cms/djangoapps/contentstore/views/course.py
+1
-1
cms/djangoapps/contentstore/views/tests/test_course_index.py
+4
-6
No files found.
cms/djangoapps/contentstore/views/course.py
View file @
bfeeeff7
...
...
@@ -336,7 +336,7 @@ def _course_outline_json(request, course_module):
"""
Returns a JSON representation of the course module and recursively all of its children.
"""
is_concise
=
request
.
GET
.
get
(
'format
s
'
)
==
'concise'
is_concise
=
request
.
GET
.
get
(
'format'
)
==
'concise'
include_children_predicate
=
lambda
xblock
:
not
xblock
.
category
==
'vertical'
if
is_concise
:
include_children_predicate
=
lambda
xblock
:
xblock
.
has_children
...
...
cms/djangoapps/contentstore/views/tests/test_course_index.py
View file @
bfeeeff7
...
...
@@ -369,9 +369,8 @@ class TestCourseOutline(CourseTestCase):
self
.
assertEqual
(
json_response
[
'category'
],
'course'
)
self
.
assertEqual
(
json_response
[
'id'
],
unicode
(
self
.
course
.
location
))
self
.
assertEqual
(
json_response
[
'display_name'
],
self
.
course
.
display_name
)
if
not
is_concise
:
self
.
assertTrue
(
json_response
[
'published'
])
self
.
assertIsNone
(
json_response
[
'visibility_state'
])
self
.
assertNotEqual
(
json_response
.
get
(
'published'
,
False
),
is_concise
)
self
.
assertIsNone
(
json_response
.
get
(
'visibility_state'
))
# Now verify the first child
children
=
json_response
[
'child_info'
][
'children'
]
...
...
@@ -380,8 +379,8 @@ class TestCourseOutline(CourseTestCase):
self
.
assertEqual
(
first_child_response
[
'category'
],
'chapter'
)
self
.
assertEqual
(
first_child_response
[
'id'
],
unicode
(
self
.
chapter
.
location
))
self
.
assertEqual
(
first_child_response
[
'display_name'
],
'Week 1'
)
self
.
assertNotEqual
(
json_response
.
get
(
'published'
,
False
),
is_concise
)
if
not
is_concise
:
self
.
assertTrue
(
json_response
[
'published'
])
self
.
assertEqual
(
first_child_response
[
'visibility_state'
],
VisibilityState
.
unscheduled
)
self
.
assertGreater
(
len
(
first_child_response
[
'child_info'
][
'children'
]),
0
)
...
...
@@ -395,8 +394,7 @@ class TestCourseOutline(CourseTestCase):
self
.
assertIsNotNone
(
json_response
[
'display_name'
])
self
.
assertIsNotNone
(
json_response
[
'id'
])
self
.
assertIsNotNone
(
json_response
[
'category'
])
if
not
is_concise
:
self
.
assertTrue
(
json_response
[
'published'
])
self
.
assertNotEqual
(
json_response
.
get
(
'published'
,
False
),
is_concise
)
if
json_response
.
get
(
'child_info'
,
None
):
for
child_response
in
json_response
[
'child_info'
][
'children'
]:
self
.
assert_correct_json_response
(
child_response
,
is_concise
)
...
...
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