Commit 9c8b9c87 by Jason Bau

make unit tests respect mongo port/host settings (with default)

settings are read in from environment variable

Conflicts:
	cms/envs/test.py
	common/lib/xmodule/xmodule/modulestore/tests/test_cross_modulestore_import_export.py
	common/lib/xmodule/xmodule/modulestore/tests/test_mongo.py
parent 12bc5245
......@@ -13,6 +13,7 @@ import datetime
import pytz
from xmodule.tabs import CoursewareTab, CourseInfoTab, StaticTab, DiscussionTab, ProgressTab, WikiTab
from xmodule.modulestore.tests.sample_courses import default_block_info_tree, TOY_BLOCK_INFO_TREE
from xmodule.modulestore.tests.mongo_connection import MONGO_PORT_NUM, MONGO_HOST
def mixed_store_config(data_dir, mappings):
......@@ -94,7 +95,8 @@ def split_mongo_store_config(data_dir):
'NAME': 'draft',
'ENGINE': 'xmodule.modulestore.split_mongo.split_draft.DraftVersioningModuleStore',
'DOC_STORE_CONFIG': {
'host': 'localhost',
'host': MONGO_HOST,
'port': MONGO_PORT_NUM,
'db': 'test_xmodule',
'collection': 'modulestore{0}'.format(uuid4().hex[:5]),
},
......
......@@ -27,6 +27,7 @@ if not settings.configured:
from xmodule.modulestore.mixed import MixedModuleStore
from xmodule.modulestore.tests.mongo_connection import MONGO_PORT_NUM, MONGO_HOST
from xmodule.modulestore.draft_and_published import UnsupportedRevisionError
from xmodule.modulestore.tests.mongo_connection import MONGO_PORT_NUM, MONGO_HOST
@ddt.ddt
......
......@@ -38,7 +38,6 @@ from xmodule.x_module import XModuleMixin
from xmodule.modulestore.mongo.base import as_draft
from xmodule.modulestore.tests.mongo_connection import MONGO_PORT_NUM, MONGO_HOST
log = logging.getLogger(__name__)
HOST = MONGO_HOST
......
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