From c56c88be4a19ede83016834fa6b13d1ad553c5fd Mon Sep 17 00:00:00 2001 From: cahrens Date: Fri, 30 Jan 2015 14:51:59 -0500 Subject: [PATCH] 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. --- .../commands/tests/test_dump_course.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/lms/djangoapps/courseware/management/commands/tests/test_dump_course.py b/lms/djangoapps/courseware/management/commands/tests/test_dump_course.py index 4ffda63514..708bb80dcc 100644 --- a/lms/djangoapps/courseware/management/commands/tests/test_dump_course.py +++ b/lms/djangoapps/courseware/management/commands/tests/test_dump_course.py @@ -8,6 +8,7 @@ import shutil from StringIO import StringIO import tarfile from tempfile import mkdtemp +import factory from django.conf import settings from django.core.management import call_command @@ -53,15 +54,14 @@ class CommandsTestBase(TestCase): """Load test courses and return list of ids""" store = modulestore() - # Add a course with a unicode name, if the modulestore - # supports adding modules. - if hasattr(store, 'create_xmodule'): - CourseFactory.create( - org=u'ëḋẌ', - course=u'śíḿṕĺé', - display_name=u'2012_Fáĺĺ', - modulestore=store - ) + # Add a course with a unicode name. + unique_org = factory.Sequence(lambda n: u'ëḋẌ.%d' % n) + CourseFactory.create( + org=unique_org, + course=u'śíḿṕĺé', + display_name=u'2012_Fáĺĺ', + modulestore=store + ) courses = store.get_courses() # NOTE: if xml store owns these, it won't import them into mongo