Commit d88b0c48 by cahrens

store.has_course fails on old mongo with unicode chars.

xml_importer now calls store.has_course even if create_course_if_not_present is False.
parent 78a8fd80
...@@ -83,6 +83,8 @@ class ContentStoreImportTest(ModuleStoreTestCase): ...@@ -83,6 +83,8 @@ class ContentStoreImportTest(ModuleStoreTestCase):
""" """
# Test that importing course with unicode 'id' and 'display name' doesn't give UnicodeEncodeError # Test that importing course with unicode 'id' and 'display name' doesn't give UnicodeEncodeError
""" """
# Test with the split modulestore because store.has_course fails in old mongo with unicode characters.
with modulestore().default_store(ModuleStoreEnum.Type.split):
module_store = modulestore() module_store = modulestore()
course_id = module_store.make_course_key(u'Юникода', u'unicode_course', u'échantillon') course_id = module_store.make_course_key(u'Юникода', u'unicode_course', u'échantillon')
import_from_xml( import_from_xml(
...@@ -91,8 +93,7 @@ class ContentStoreImportTest(ModuleStoreTestCase): ...@@ -91,8 +93,7 @@ class ContentStoreImportTest(ModuleStoreTestCase):
TEST_DATA_DIR, TEST_DATA_DIR,
['2014_Uni'], ['2014_Uni'],
target_course_id=course_id, target_course_id=course_id,
# When this test is run with split modulestore as the default, the create course option must be specified. create_course_if_not_present=True
# create_course_if_not_present=True
) )
course = module_store.get_course(course_id) course = module_store.get_course(course_id)
......
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