diff --git a/cms/envs/acceptance.py b/cms/envs/acceptance.py index 4d1f1f2a4b..4b27c2a24f 100644 --- a/cms/envs/acceptance.py +++ b/cms/envs/acceptance.py @@ -21,7 +21,7 @@ MODULESTORE_OPTIONS = { 'default_class': 'xmodule.raw_module.RawDescriptor', 'host': 'localhost', 'db': 'test_xmodule', - 'collection': 'acceptance_modulestore', + 'collection': 'acceptance_modulestore_%s' % uuid4().hex, 'fs_root': TEST_ROOT / "data", 'render_template': 'mitxmako.shortcuts.render_to_string', } @@ -45,7 +45,7 @@ CONTENTSTORE = { 'ENGINE': 'xmodule.contentstore.mongo.MongoContentStore', 'OPTIONS': { 'host': 'localhost', - 'db': 'acceptance_xcontent', + 'db': 'acceptance_xcontent_%s' % uuid4().hex, }, # allow for additional options that can be keyed on a name, e.g. 'trashcan' 'ADDITIONAL_OPTIONS': { diff --git a/common/djangoapps/terrain/browser.py b/common/djangoapps/terrain/browser.py index d237edc4b7..6b2114d8cc 100644 --- a/common/djangoapps/terrain/browser.py +++ b/common/djangoapps/terrain/browser.py @@ -17,6 +17,8 @@ from selenium.common.exceptions import WebDriverException # These names aren't used, but do important work on import. from lms import one_time_startup # pylint: disable=W0611 from cms import one_time_startup # pylint: disable=W0611 +from pymongo import MongoClient +import xmodule.modulestore.django # There is an import issue when using django-staticfiles with lettuce # Lettuce assumes that we are using django.contrib.staticfiles, @@ -103,3 +105,7 @@ def teardown_browser(total): Quit the browser after executing the tests. """ world.browser.quit() + mongo = MongoClient() + mongo.drop_database(settings.CONTENTSTORE['OPTIONS']['db']) + modulestore = xmodule.modulestore.django.modulestore() + modulestore.collection.drop() diff --git a/lms/envs/acceptance.py b/lms/envs/acceptance.py index 3b87bb4326..be604eea8d 100644 --- a/lms/envs/acceptance.py +++ b/lms/envs/acceptance.py @@ -16,13 +16,14 @@ DEBUG = True # Disable warnings for acceptance tests, to make the logs readable import logging logging.disable(logging.ERROR) +from uuid import uuid4 # Use the mongo store for acceptance tests modulestore_options = { 'default_class': 'xmodule.raw_module.RawDescriptor', 'host': 'localhost', 'db': 'test_xmodule', - 'collection': 'acceptance_modulestore', + 'collection': 'acceptance_modulestore_%s' % uuid4().hex, 'fs_root': TEST_ROOT / "data", 'render_template': 'mitxmako.shortcuts.render_to_string', } @@ -42,7 +43,7 @@ CONTENTSTORE = { 'ENGINE': 'xmodule.contentstore.mongo.MongoContentStore', 'OPTIONS': { 'host': 'localhost', - 'db': 'test_xmodule', + 'db': 'acceptance_xcontent_%s' % uuid4().hex, } }