Commit 3dbe4c18 by Chris Dodge

add unit tests around asserting that /static/ links are not re-written on import

parent d329e3c8
...@@ -303,6 +303,16 @@ class ContentStoreToyCourseTest(ModuleStoreTestCase): ...@@ -303,6 +303,16 @@ class ContentStoreToyCourseTest(ModuleStoreTestCase):
num_drafts = self._get_draft_counts(course) num_drafts = self._get_draft_counts(course)
self.assertEqual(num_drafts, 1) self.assertEqual(num_drafts, 1)
def test_no_static_link_rewrites_on_import(self):
module_store = modulestore('direct')
import_from_xml(module_store, 'common/test/data/', ['toy'])
handouts = module_store.get_item(Location(['i4x', 'edX', 'toy', 'course_info', 'handouts', None]))
self.assertIn('/static/', handouts.data)
handouts = module_store.get_item(Location(['i4x', 'edX', 'toy', 'html', 'toyhtml', None]))
self.assertIn('/static/', handouts.data)
def test_import_textbook_as_content_element(self): def test_import_textbook_as_content_element(self):
module_store = modulestore('direct') module_store = modulestore('direct')
import_from_xml(module_store, 'common/test/data/', ['toy']) import_from_xml(module_store, 'common/test/data/', ['toy'])
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
<videosequence url_name="Toy_Videos"> <videosequence url_name="Toy_Videos">
<html url_name="secret:toylab"/> <html url_name="secret:toylab"/>
<html url_name="toyjumpto"/> <html url_name="toyjumpto"/>
<html url_name="toyhtml"/>
<video url_name="Video_Resources" youtube_id_1_0="1bK-WdDi6Qw" display_name="Video Resources"/> <video url_name="Video_Resources" youtube_id_1_0="1bK-WdDi6Qw" display_name="Video Resources"/>
</videosequence> </videosequence>
<video url_name="Welcome" youtube_id_1_0="p2Q6BrNhdh8" display_name="Welcome"/> <video url_name="Welcome" youtube_id_1_0="p2Q6BrNhdh8" display_name="Welcome"/>
......
<a href='/static/handouts/sample_handout.txt'>Sample</a>
\ No newline at end of file
<html filename="toyhtml.html"/>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment