From 0c1c3f11af676a4bf0449e9a183ddea96bb10e9e Mon Sep 17 00:00:00 2001 From: Chris Dodge Date: Wed, 21 Aug 2013 20:48:56 -0400 Subject: [PATCH] loop in static import testing into common/* tests --- cms/djangoapps/contentstore/tests/test_contentstore.py | 2 +- common/lib/xmodule/xmodule/modulestore/tests/test_mongo.py | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/cms/djangoapps/contentstore/tests/test_contentstore.py b/cms/djangoapps/contentstore/tests/test_contentstore.py index 96b0b84e36..2a69fc451c 100644 --- a/cms/djangoapps/contentstore/tests/test_contentstore.py +++ b/cms/djangoapps/contentstore/tests/test_contentstore.py @@ -476,7 +476,7 @@ class ContentStoreToyCourseTest(ModuleStoreTestCase): content_store = contentstore() module_store = modulestore('direct') - import_from_xml(module_store, 'common/test/data/', ['toy'], static_content_store=content_store) + import_from_xml(module_store, 'common/test/data/', ['toy'], static_content_store=content_store, verbose=True) course_location = CourseDescriptor.id_to_location('edX/toy/2012_Fall') course = module_store.get_item(course_location) diff --git a/common/lib/xmodule/xmodule/modulestore/tests/test_mongo.py b/common/lib/xmodule/xmodule/modulestore/tests/test_mongo.py index 17036a16bf..f047ef8e41 100644 --- a/common/lib/xmodule/xmodule/modulestore/tests/test_mongo.py +++ b/common/lib/xmodule/xmodule/modulestore/tests/test_mongo.py @@ -11,6 +11,7 @@ from xmodule.tests import DATA_DIR from xmodule.modulestore import Location from xmodule.modulestore.mongo import MongoModuleStore, MongoKeyValueStore from xmodule.modulestore.xml_importer import import_from_xml +from xmodule.contentstore.mongo import MongoContentStore from xmodule.modulestore.tests.test_modulestore import check_path_to_location @@ -46,9 +47,12 @@ class TestMongoModuleStore(object): def initdb(): # connect to the db store = MongoModuleStore(HOST, DB, COLLECTION, FS_ROOT, RENDER_TEMPLATE, default_class=DEFAULT_CLASS) + # since MongoModuleStore and MongoContentStore are basically assumed to be together, create this class + # as well + content_store = MongoContentStore(HOST, DB) # Explicitly list the courses to load (don't want the big one) courses = ['toy', 'simple'] - import_from_xml(store, DATA_DIR, courses) + import_from_xml(store, DATA_DIR, courses, static_content_store=content_store) return store @staticmethod