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
0b685d89
Commit
0b685d89
authored
Jan 10, 2016
by
M. Rehan
Committed by
Douglas Hall
Jan 12, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix for course number display string as none
parent
b4189784
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
1 deletions
+22
-1
cms/djangoapps/contentstore/views/tests/test_course_index.py
+21
-0
cms/templates/base.html
+1
-1
No files found.
cms/djangoapps/contentstore/views/tests/test_course_index.py
View file @
0b685d89
...
...
@@ -289,6 +289,27 @@ class TestCourseIndex(CourseTestCase):
response
=
self
.
client
.
get_html
(
course_outline_url_split
)
self
.
assertEqual
(
response
.
status_code
,
404
)
def
test_course_outline_with_display_course_number_as_none
(
self
):
"""
Tests course outline when 'display_coursenumber' field is none.
"""
# Change 'display_coursenumber' field to None and update the course.
self
.
course
.
display_coursenumber
=
None
updated_course
=
self
.
update_course
(
self
.
course
,
self
.
user
.
id
)
# Assert that 'display_coursenumber' field has been changed successfully.
self
.
assertEqual
(
updated_course
.
display_coursenumber
,
None
)
# Perform GET request on course outline url with the course id.
course_outline_url
=
reverse_course_url
(
'course_handler'
,
updated_course
.
id
)
response
=
self
.
client
.
get_html
(
course_outline_url
)
# Assert that response code is 200.
self
.
assertEqual
(
response
.
status_code
,
200
)
# Assert that 'display_course_number' is being set to "" (as display_coursenumber was None).
self
.
assertIn
(
'display_course_number: ""'
,
response
.
content
)
@ddt.ddt
class
TestCourseOutline
(
CourseTestCase
):
...
...
cms/templates/base.html
View file @
0b685d89
...
...
@@ -85,7 +85,7 @@ from openedx.core.lib.js_utils import (
url_name
:
"${context_course.location.name | h}"
,
org
:
"${context_course.location.org | h}"
,
num
:
"${context_course.location.course | h}"
,
display_course_number
:
"${_(context_course.display_coursenumber)}"
,
display_course_number
:
"${_(context_course.display_coursenumber)
if context_course.display_coursenumber else ''
}"
,
revision
:
"${context_course.location.revision | h}"
,
self_paced
:
$
{
escape_json_dumps
(
context_course
.
self_paced
)
|
n
}
});
...
...
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