diff --git a/common/lib/xmodule/xmodule/modulestore/tests/test_mongo.py b/common/lib/xmodule/xmodule/modulestore/tests/test_mongo.py
index ffcbe1717d..55e573677f 100644
--- a/common/lib/xmodule/xmodule/modulestore/tests/test_mongo.py
+++ b/common/lib/xmodule/xmodule/modulestore/tests/test_mongo.py
@@ -1,28 +1,61 @@
+import pymongo
+
from nose.tools import assert_equals, assert_raises, assert_not_equals, with_setup
+from path import path
+
from xmodule.modulestore import Location
from xmodule.modulestore.exceptions import InvalidLocationError
from xmodule.modulestore.mongo import MongoModuleStore
+from xmodule.modulestore.xml_importer import import_from_xml
+
+# from ~/mitx_all/mitx/common/lib/xmodule/xmodule/modulestore/tests/
+# to ~/mitx_all/mitx/common/test
+TEST_DIR = path(__file__).abspath().dirname()
+for i in range(5):
+ TEST_DIR = TEST_DIR.dirname()
+TEST_DIR = TEST_DIR / 'test'
+
+DATA_DIR = TEST_DIR / 'data'
-host = 'localhost'
-db = 'xmodule'
-collection = 'modulestore'
-fs_root = None # TODO (vshnayder): will need a real fs_root for testing load_item
-default_class = 'xmodule.raw_module.RawDescriptor'
+HOST = 'localhost'
+PORT = 27017
+DB = 'test'
+COLLECTION = 'modulestore'
+FS_ROOT = DATA_DIR # TODO (vshnayder): will need a real fs_root for testing load_item
+DEFAULT_CLASS = 'xmodule.raw_module.RawDescriptor'
+connection = None
+
+def setup():
+ global connection
+ connection = pymongo.connection.Connection(HOST, PORT)
+
+
def setup_func():
# connect to the db
global store
- store = MongoModuleStore(host, db, collection, fs_root, default_class=default_class)
+ store = MongoModuleStore(HOST, DB, COLLECTION, FS_ROOT, default_class=DEFAULT_CLASS)
+ print 'data_dir: {0}'.format(DATA_DIR)
+ import_from_xml(store, DATA_DIR)
def teardown_func():
global store
store = None
+ # Destroy the test db.
+ connection.drop_database(DB)
+
@with_setup(setup_func, teardown_func)
def test_init():
'''Just make sure the db loads'''
pass
+@with_setup(setup_func, teardown_func)
+def test_get_courses():
+ '''Make sure the course objects loaded properly'''
+ courses = store.get_courses()
+ print courses
+
diff --git a/common/test/data/toy/course.xml b/common/test/data/toy/course.xml
index ba4b295c2e..391eb68e2b 100644
--- a/common/test/data/toy/course.xml
+++ b/common/test/data/toy/course.xml
@@ -2,7 +2,7 @@
-
+
diff --git a/common/test/data/toy/html/Lab2A.html b/common/test/data/toy/html/Lab2A.html
deleted file mode 100644
index 7fe52cc1be..0000000000
--- a/common/test/data/toy/html/Lab2A.html
+++ /dev/null
@@ -1,105 +0,0 @@
-
-
-Lab 2A: Superposition Experiment
-
-
Note: This part of the lab is just to develop your intuition about
-superposition. There are no responses that need to be checked.
-
-
Circuits with multiple sources can be hard to analyze as-is. For example, what is the voltage
-between the two terminals on the right of Figure 1?
-
-
-
-Figure 1. Example multi-source circuit
-
-
-
We can use superposition to make the analysis much easier.
-The circuit in Figure 1 can be decomposed into two separate
-subcircuits: one involving only the voltage source and one involving only the
-current source. We'll analyze each circuit separately and combine the
-results using superposition. Recall that to decompose a circuit for
-analysis, we'll pick each source in turn and set all the other sources
-to zero (i.e., voltage sources become short circuits and current
-sources become open circuits). The circuit above has two sources, so
-the decomposition produces two subcircuits, as shown in Figure 2.
-
-
-
-
-(a) Subcircuit for analyzing contribution of voltage source
-
-
-(b) Subcircuit for analyzing contribution of current source
-
- Figure 2. Decomposition of Figure 1 into subcircuits
-
-
- Let's use the DC analysis capability of the schematic tool to see superposition
-in action. The sliders below control the resistances of R1, R2, R3 and R4 in all
-the diagrams. As you move the sliders, the schematic tool will adjust the appropriate
-resistance, perform a DC analysis and display the node voltages on the diagrams. Here's
-what you want to observe as you play with the sliders:
-
-
-The voltage for a node in Figure 1 is the sum of the voltages for
-that node in Figures 2(a) and 2(b), just as predicted by
-superposition. (Note that due to round-off in the display of the
-voltages, the sum of the displayed voltages in Figure 2 may only be within
-.01 of the voltages displayed in Figure 1.)
-