Commit e4af7287 by JonahStanley

Initial testing for parallelization

parent 5ba6855d
...@@ -43,10 +43,13 @@ from django_comment_common.utils import are_permissions_roles_seeded ...@@ -43,10 +43,13 @@ from django_comment_common.utils import are_permissions_roles_seeded
from xmodule.exceptions import InvalidVersionError from xmodule.exceptions import InvalidVersionError
import datetime import datetime
from pytz import UTC from pytz import UTC
#from uuid import uuid4
TEST_DATA_MODULESTORE = copy.deepcopy(settings.MODULESTORE) TEST_DATA_MODULESTORE = copy.deepcopy(settings.MODULESTORE)
TEST_DATA_MODULESTORE['default']['OPTIONS']['fs_root'] = path('common/test/data') TEST_DATA_MODULESTORE['default']['OPTIONS']['fs_root'] = path('common/test/data')
TEST_DATA_MODULESTORE['direct']['OPTIONS']['fs_root'] = path('common/test/data') TEST_DATA_MODULESTORE['direct']['OPTIONS']['fs_root'] = path('common/test/data')
TEST_DATA_CONTENTSTORE = copy.deepcopy(settings.CONTENTSTORE)
TEST_DATA_CONTENTSTORE['OPTIONS']['db'] = 'test_xcontent_%s' % 4 #uuid4().hex
class MongoCollectionFindWrapper(object): class MongoCollectionFindWrapper(object):
...@@ -60,6 +63,7 @@ class MongoCollectionFindWrapper(object): ...@@ -60,6 +63,7 @@ class MongoCollectionFindWrapper(object):
@override_settings(MODULESTORE=TEST_DATA_MODULESTORE) @override_settings(MODULESTORE=TEST_DATA_MODULESTORE)
@override_settings(CONTENTSTORE=TEST_DATA_CONTENTSTORE)
class ContentStoreToyCourseTest(ModuleStoreTestCase): class ContentStoreToyCourseTest(ModuleStoreTestCase):
""" """
Tests that rely on the toy courses. Tests that rely on the toy courses.
...@@ -83,6 +87,7 @@ class ContentStoreToyCourseTest(ModuleStoreTestCase): ...@@ -83,6 +87,7 @@ class ContentStoreToyCourseTest(ModuleStoreTestCase):
self.client = Client() self.client = Client()
self.client.login(username=uname, password=password) self.client.login(username=uname, password=password)
def check_components_on_page(self, component_types, expected_types): def check_components_on_page(self, component_types, expected_types):
""" """
Ensure that the right types end up on the page. Ensure that the right types end up on the page.
...@@ -809,6 +814,7 @@ class ContentStoreToyCourseTest(ModuleStoreTestCase): ...@@ -809,6 +814,7 @@ class ContentStoreToyCourseTest(ModuleStoreTestCase):
export_to_xml(module_store, content_store, location, root_dir, 'test_export') export_to_xml(module_store, content_store, location, root_dir, 'test_export')
@override_settings(CONTENTSTORE=TEST_DATA_CONTENTSTORE)
class ContentStoreTest(ModuleStoreTestCase): class ContentStoreTest(ModuleStoreTestCase):
""" """
Tests for the CMS ContentStore application. Tests for the CMS ContentStore application.
......
...@@ -70,7 +70,7 @@ CONTENTSTORE = { ...@@ -70,7 +70,7 @@ CONTENTSTORE = {
'ENGINE': 'xmodule.contentstore.mongo.MongoContentStore', 'ENGINE': 'xmodule.contentstore.mongo.MongoContentStore',
'OPTIONS': { 'OPTIONS': {
'host': 'localhost', 'host': 'localhost',
'db': 'test_xmodule', 'db': 'test_xcontent',
}, },
# 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': {
......
...@@ -27,6 +27,7 @@ class ModuleStoreTestCase(TestCase): ...@@ -27,6 +27,7 @@ class ModuleStoreTestCase(TestCase):
# Remove everything except templates # Remove everything except templates
modulestore.collection.remove(query) modulestore.collection.remove(query)
modulestore.collection.drop()
@staticmethod @staticmethod
def load_templates_if_necessary(): def load_templates_if_necessary():
......
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