Commit c56c88be by cahrens

create_xmodule was renamed to create_xblock, and mixed modulestore has create_xblock method.

Split modulestore throws duplicate errors if course locator is not unique.
parent 7a64e6f6
...@@ -8,6 +8,7 @@ import shutil ...@@ -8,6 +8,7 @@ import shutil
from StringIO import StringIO from StringIO import StringIO
import tarfile import tarfile
from tempfile import mkdtemp from tempfile import mkdtemp
import factory
from django.conf import settings from django.conf import settings
from django.core.management import call_command from django.core.management import call_command
...@@ -53,15 +54,14 @@ class CommandsTestBase(TestCase): ...@@ -53,15 +54,14 @@ class CommandsTestBase(TestCase):
"""Load test courses and return list of ids""" """Load test courses and return list of ids"""
store = modulestore() store = modulestore()
# Add a course with a unicode name, if the modulestore # Add a course with a unicode name.
# supports adding modules. unique_org = factory.Sequence(lambda n: u'ëḋẌ.%d' % n)
if hasattr(store, 'create_xmodule'): CourseFactory.create(
CourseFactory.create( org=unique_org,
org=u'ëḋẌ', course=u'śíḿṕĺé',
course=u'śíḿṕĺé', display_name=u'2012_Fáĺĺ',
display_name=u'2012_Fáĺĺ', modulestore=store
modulestore=store )
)
courses = store.get_courses() courses = store.get_courses()
# NOTE: if xml store owns these, it won't import them into mongo # NOTE: if xml store owns these, it won't import them into mongo
......
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