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
b9096b1b
Commit
b9096b1b
authored
Nov 15, 2013
by
Gabe Mulley
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
prevent failure when module does not have a data field
parent
0d3c18df
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
2 deletions
+16
-2
cms/djangoapps/contentstore/tests/test_item.py
+14
-0
cms/djangoapps/contentstore/views/item.py
+2
-2
No files found.
cms/djangoapps/contentstore/tests/test_item.py
View file @
b9096b1b
...
...
@@ -65,6 +65,20 @@ class ItemTest(CourseTestCase):
return
self
.
client
.
ajax_post
(
'/xblock'
,
json
.
dumps
(
data
))
class
GetItem
(
ItemTest
):
"""Tests for '/xblock' GET url."""
def
test_get_vertical
(
self
):
# Add a vertical
resp
=
self
.
create_xblock
(
category
=
'vertical'
)
self
.
assertEqual
(
resp
.
status_code
,
200
)
# Retrieve it
resp_content
=
json
.
loads
(
resp
.
content
)
resp
=
self
.
client
.
get
(
'/xblock/'
+
resp_content
[
'locator'
])
self
.
assertEqual
(
resp
.
status_code
,
200
)
class
DeleteItem
(
ItemTest
):
"""Tests for '/xblock' DELETE url."""
def
test_delete_static_page
(
self
):
...
...
cms/djangoapps/contentstore/views/item.py
View file @
b9096b1b
...
...
@@ -365,12 +365,12 @@ def _get_module_info(usage_loc, rewrite_static_links=True):
else
:
raise
data
=
module
.
data
data
=
getattr
(
module
,
'data'
,
''
)
if
rewrite_static_links
:
# we pass a partially bogus course_id as we don't have the RUN information passed yet
# through the CMS. Also the contentstore is also not RUN-aware at this point in time.
data
=
replace_static_urls
(
module
.
data
,
data
,
None
,
course_id
=
module
.
location
.
org
+
'/'
+
module
.
location
.
course
+
'/BOGUS_RUN_REPLACE_WHEN_AVAILABLE'
)
...
...
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