always serialize out HTML content to a separate .html file

This commit is contained in:
Chris Dodge
2013-08-20 22:43:53 -04:00
parent e79f8c437a
commit 5a7bcd7bb3
3 changed files with 27 additions and 6 deletions

View File

@@ -1057,6 +1057,31 @@ class ContentStoreToyCourseTest(ModuleStoreTestCase):
# It should now contain empty data
self.assertEquals(imported_word_cloud.data, '')
def test_html_export_roundtrip(self):
"""
Test that a course which has HTML that has style formatting is preserved in export/import
"""
module_store = modulestore('direct')
content_store = contentstore()
import_from_xml(module_store, 'common/test/data/', ['toy'])
location = CourseDescriptor.id_to_location('edX/toy/2012_Fall')
# Export the course
root_dir = path(mkdtemp_clean())
export_to_xml(module_store, content_store, location, root_dir, 'test_roundtrip')
# Reimport and get the video back
import_from_xml(module_store, root_dir)
# get the sample HTML with styling information
html_module = module_store.get_instance(
'edX/toy/2012_Fall',
Location(['i4x', 'edX', 'toy', 'html', 'with_styling'])
)
self.assertIn('<p style="font:italic bold 72px/30px Georgia, serif; color: red; ">', html_module.data)
def test_course_handouts_rewrites(self):
module_store = modulestore('direct')