Commit 789b7110 by JonahStanley

Acceptance tests now pull from their own unique database

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