diff --git a/common/lib/xmodule/xmodule/modulestore/mongo/base.py b/common/lib/xmodule/xmodule/modulestore/mongo/base.py index 78932ecccd..276f7ccdbc 100644 --- a/common/lib/xmodule/xmodule/modulestore/mongo/base.py +++ b/common/lib/xmodule/xmodule/modulestore/mongo/base.py @@ -297,7 +297,6 @@ class MongoModuleStore(ModuleStoreWriteBase): # that is used when querying by a location self.collection.ensure_index( zip(('_id.' + field for field in Location._fields), repeat(1)), - name="location_index" ) if default_class is not None: diff --git a/common/lib/xmodule/xmodule/modulestore/tests/django_utils.py b/common/lib/xmodule/xmodule/modulestore/tests/django_utils.py index 16f756b233..862c9e600e 100644 --- a/common/lib/xmodule/xmodule/modulestore/tests/django_utils.py +++ b/common/lib/xmodule/xmodule/modulestore/tests/django_utils.py @@ -55,7 +55,7 @@ def mongo_store_config(data_dir): 'DOC_STORE_CONFIG': { 'host': 'localhost', 'db': 'test_xmodule', - 'collection': 'modulestore_%s' % uuid4().hex, + 'collection': 'modulestore{0}'.format(uuid4().hex[:5]), }, 'OPTIONS': { 'default_class': 'xmodule.raw_module.RawDescriptor', @@ -86,7 +86,7 @@ def draft_mongo_store_config(data_dir): 'DOC_STORE_CONFIG': { 'host': 'localhost', 'db': 'test_xmodule', - 'collection': 'modulestore_%s' % uuid4().hex, + 'collection': 'modulestore{0}'.format(uuid4().hex[:5]), }, 'OPTIONS': modulestore_options } @@ -121,7 +121,7 @@ def studio_store_config(data_dir): store_config = { 'host': 'localhost', 'db': 'test_xmodule', - 'collection': 'modulestore_%s' % uuid4().hex, + 'collection': 'modulestore{0}'.format(uuid4().hex[:5]), } options = { 'default_class': 'xmodule.raw_module.RawDescriptor', diff --git a/common/lib/xmodule/xmodule/modulestore/tests/test_location_mapper.py b/common/lib/xmodule/xmodule/modulestore/tests/test_location_mapper.py index 2fbff10423..087a1951a9 100644 --- a/common/lib/xmodule/xmodule/modulestore/tests/test_location_mapper.py +++ b/common/lib/xmodule/xmodule/modulestore/tests/test_location_mapper.py @@ -20,7 +20,7 @@ class TestLocationMapper(unittest.TestCase): modulestore_options = { 'host': 'localhost', 'db': 'test_xmodule', - 'collection': 'modulestore{0}'.format(uuid.uuid4().hex), + 'collection': 'modulestore{0}'.format(uuid.uuid4().hex[:5]), } # pylint: disable=W0142 diff --git a/common/lib/xmodule/xmodule/modulestore/tests/test_mixed_modulestore.py b/common/lib/xmodule/xmodule/modulestore/tests/test_mixed_modulestore.py index 12302b6fde..04ff4bb15c 100644 --- a/common/lib/xmodule/xmodule/modulestore/tests/test_mixed_modulestore.py +++ b/common/lib/xmodule/xmodule/modulestore/tests/test_mixed_modulestore.py @@ -21,7 +21,7 @@ from xmodule.modulestore.mixed import MixedModuleStore HOST = 'localhost' PORT = 27017 -DB = 'test_mongo_%s' % uuid4().hex +DB = 'test_mongo_%s' % uuid4().hex[:5] COLLECTION = 'modulestore' FS_ROOT = DATA_DIR DEFAULT_CLASS = 'xmodule.raw_module.RawDescriptor' diff --git a/common/lib/xmodule/xmodule/modulestore/tests/test_mongo.py b/common/lib/xmodule/xmodule/modulestore/tests/test_mongo.py index e02f37ae76..44e5889f0c 100644 --- a/common/lib/xmodule/xmodule/modulestore/tests/test_mongo.py +++ b/common/lib/xmodule/xmodule/modulestore/tests/test_mongo.py @@ -28,7 +28,7 @@ log = logging.getLogger(__name__) HOST = 'localhost' PORT = 27017 -DB = 'test_mongo_%s' % uuid4().hex +DB = 'test_mongo_%s' % uuid4().hex[:5] COLLECTION = 'modulestore' FS_ROOT = DATA_DIR # TODO (vshnayder): will need a real fs_root for testing load_item DEFAULT_CLASS = 'xmodule.raw_module.RawDescriptor' diff --git a/common/lib/xmodule/xmodule/modulestore/tests/test_orphan.py b/common/lib/xmodule/xmodule/modulestore/tests/test_orphan.py index 073531094f..145aa77c23 100644 --- a/common/lib/xmodule/xmodule/modulestore/tests/test_orphan.py +++ b/common/lib/xmodule/xmodule/modulestore/tests/test_orphan.py @@ -33,7 +33,7 @@ class TestOrphan(unittest.TestCase): split_course_id = 'test_org.test_course.runid' def setUp(self): - self.db_config['collection'] = 'modulestore{0}'.format(uuid.uuid4().hex) + self.db_config['collection'] = 'modulestore{0}'.format(uuid.uuid4().hex[:5]) self.userid = random.getrandbits(32) super(TestOrphan, self).setUp() diff --git a/common/lib/xmodule/xmodule/modulestore/tests/test_publish.py b/common/lib/xmodule/xmodule/modulestore/tests/test_publish.py index f36b98e24a..867351370c 100644 --- a/common/lib/xmodule/xmodule/modulestore/tests/test_publish.py +++ b/common/lib/xmodule/xmodule/modulestore/tests/test_publish.py @@ -34,7 +34,7 @@ class TestPublish(unittest.TestCase): } def setUp(self): - self.db_config['collection'] = 'modulestore{0}'.format(uuid.uuid4().hex) + self.db_config['collection'] = 'modulestore{0}'.format(uuid.uuid4().hex[:5]) self.old_mongo = MongoModuleStore(self.db_config, **self.modulestore_options) self.draft_mongo = DraftMongoModuleStore(self.db_config, **self.modulestore_options) diff --git a/common/lib/xmodule/xmodule/modulestore/tests/test_split_migrator.py b/common/lib/xmodule/xmodule/modulestore/tests/test_split_migrator.py index 74975f2896..7ddab1e376 100644 --- a/common/lib/xmodule/xmodule/modulestore/tests/test_split_migrator.py +++ b/common/lib/xmodule/xmodule/modulestore/tests/test_split_migrator.py @@ -31,7 +31,7 @@ class TestMigration(unittest.TestCase): db_config = { 'host': 'localhost', 'db': 'test_xmodule', - 'collection': 'modulestore{0}'.format(uuid.uuid4().hex), + 'collection': 'modulestore{0}'.format(uuid.uuid4().hex[:5]), } modulestore_options = { diff --git a/common/lib/xmodule/xmodule/modulestore/tests/test_split_modulestore.py b/common/lib/xmodule/xmodule/modulestore/tests/test_split_modulestore.py index 2e89b761d2..7cb98b26e7 100644 --- a/common/lib/xmodule/xmodule/modulestore/tests/test_split_modulestore.py +++ b/common/lib/xmodule/xmodule/modulestore/tests/test_split_modulestore.py @@ -32,7 +32,7 @@ class SplitModuleTest(unittest.TestCase): DOC_STORE_CONFIG = { 'host': 'localhost', 'db': 'test_xmodule', - 'collection': 'modulestore{0}'.format(uuid.uuid4().hex), + 'collection': 'modulestore{0}'.format(uuid.uuid4().hex[:5]), } modulestore_options = { 'default_class': 'xmodule.raw_module.RawDescriptor',