Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions cms/djangoapps/contentstore/tests/test_item.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,20 @@ def create_xblock(self, parent_locator=None, display_name=None, category=None, b
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):
Expand Down
4 changes: 2 additions & 2 deletions cms/djangoapps/contentstore/views/item.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'
)
Expand Down