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
d17a0c6a
Commit
d17a0c6a
authored
Mar 18, 2015
by
Syed Hassan Raza
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
handle invalid-key exception for split courses
parent
d182b8db
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
0 deletions
+16
-0
lms/djangoapps/courseware/courses.py
+4
-0
lms/djangoapps/courseware/tests/test_module_render.py
+12
-0
No files found.
lms/djangoapps/courseware/courses.py
View file @
d17a0c6a
...
...
@@ -134,6 +134,10 @@ def course_image_url(course):
url
+=
'/'
+
course
.
course_image
else
:
url
+=
'/images/course_image.jpg'
elif
course
.
course_image
==
''
:
# if course_image is empty the url will be blank as location
# of the course_image does not exist
url
=
''
else
:
loc
=
StaticContent
.
compute_location
(
course
.
id
,
course
.
course_image
)
url
=
StaticContent
.
serialize_asset_key_with_slash
(
loc
)
...
...
lms/djangoapps/courseware/tests/test_module_render.py
View file @
d17a0c6a
...
...
@@ -529,6 +529,7 @@ class TestTOC(ModuleStoreTestCase):
self
.
assertIn
(
toc_section
,
actual
)
@ddt.ddt
class
TestHtmlModifiers
(
ModuleStoreTestCase
):
"""
Tests to verify that standard modifications to the output of XModule/XBlock
...
...
@@ -639,6 +640,17 @@ class TestHtmlModifiers(ModuleStoreTestCase):
self
.
assertTrue
(
url
.
startswith
(
'/static/toy_course_dir/'
))
self
.
course
.
static_asset_path
=
""
@ddt.data
(
ModuleStoreEnum
.
Type
.
mongo
,
ModuleStoreEnum
.
Type
.
split
)
def
test_course_image_for_split_course
(
self
,
store
):
"""
for split courses if course_image is empty then course_image_url will be blank
"""
self
.
course
=
CourseFactory
.
create
(
default_store
=
store
)
self
.
course
.
course_image
=
''
url
=
course_image_url
(
self
.
course
)
self
.
assertEqual
(
''
,
url
)
def
test_get_course_info_section
(
self
):
self
.
course
.
static_asset_path
=
"toy_course_dir"
get_course_info_section
(
self
.
request
,
self
.
course
,
"handouts"
)
...
...
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