From 3daeb59aca29aef7eb9a799016908dabe1ab4148 Mon Sep 17 00:00:00 2001 From: Don Mitchell Date: Mon, 23 Sep 2013 14:09:58 -0400 Subject: [PATCH 1/2] Fixed missing read (cut/paste f'up) --- common/lib/xmodule/xmodule/contentstore/mongo.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/lib/xmodule/xmodule/contentstore/mongo.py b/common/lib/xmodule/xmodule/contentstore/mongo.py index 2043cad4d6..40c0b4bc9f 100644 --- a/common/lib/xmodule/xmodule/contentstore/mongo.py +++ b/common/lib/xmodule/xmodule/contentstore/mongo.py @@ -63,7 +63,7 @@ class MongoContentStore(ContentStore): else: with self.fs.get(content_id) as fp: return StaticContent( - location, fp.displayname, fp.content_type, fp, last_modified_at=fp.uploadDate, + location, fp.displayname, fp.content_type, fp.read(), last_modified_at=fp.uploadDate, thumbnail_location=getattr(fp, 'thumbnail_location', None), import_path=getattr(fp, 'import_path', None), length=fp.length, locked=getattr(fp, 'locked', False) From e993a00d21ce18a21779512503fc887e1c4676c8 Mon Sep 17 00:00:00 2001 From: Don Mitchell Date: Mon, 23 Sep 2013 14:34:36 -0400 Subject: [PATCH 2/2] Test import-export-import assets --- cms/djangoapps/contentstore/tests/test_contentstore.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cms/djangoapps/contentstore/tests/test_contentstore.py b/cms/djangoapps/contentstore/tests/test_contentstore.py index 74c1c3367c..32928bb2fd 100644 --- a/cms/djangoapps/contentstore/tests/test_contentstore.py +++ b/cms/djangoapps/contentstore/tests/test_contentstore.py @@ -907,7 +907,7 @@ class ContentStoreToyCourseTest(ModuleStoreTestCase): draft_store = modulestore('draft') content_store = contentstore() - import_from_xml(module_store, 'common/test/data/', ['toy']) + import_from_xml(module_store, 'common/test/data/', ['toy'], static_content_store=content_store) location = CourseDescriptor.id_to_location('edX/toy/2012_Fall') # get a vertical (and components in it) to copy into an orphan sub dag @@ -986,7 +986,9 @@ class ContentStoreToyCourseTest(ModuleStoreTestCase): delete_course(module_store, content_store, location, commit=True) # reimport - import_from_xml(module_store, root_dir, ['test_export'], draft_store=draft_store) + import_from_xml( + module_store, root_dir, ['test_export'], draft_store=draft_store, static_content_store=content_store + ) items = module_store.get_items(Location(['i4x', 'edX', 'toy', 'vertical', None])) self.assertGreater(len(items), 0)