From 7edfd185b79ee02b80dd134a93c3ccfc493abd42 Mon Sep 17 00:00:00 2001 From: Chris Dodge Date: Thu, 22 Aug 2013 17:35:38 -0400 Subject: [PATCH] teardown the content database after tests --- cms/djangoapps/contentstore/tests/test_import_nostatic.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/cms/djangoapps/contentstore/tests/test_import_nostatic.py b/cms/djangoapps/contentstore/tests/test_import_nostatic.py index aad6ffbfe4..67f2202011 100644 --- a/cms/djangoapps/contentstore/tests/test_import_nostatic.py +++ b/cms/djangoapps/contentstore/tests/test_import_nostatic.py @@ -18,12 +18,13 @@ from xmodule.modulestore.django import modulestore from xmodule.contentstore.django import contentstore from xmodule.modulestore.xml_importer import import_from_xml from xmodule.contentstore.content import StaticContent +from xmodule.contentstore.django import _CONTENTSTORE from xmodule.course_module import CourseDescriptor from xmodule.exceptions import NotFoundError from uuid import uuid4 - +from pymongo import MongoClient TEST_DATA_CONTENTSTORE = copy.deepcopy(settings.CONTENTSTORE) TEST_DATA_CONTENTSTORE['OPTIONS']['db'] = 'test_xcontent_%s' % uuid4().hex @@ -58,6 +59,10 @@ class ContentStoreImportNoStaticTest(ModuleStoreTestCase): self.client = Client() self.client.login(username=uname, password=password) + def tearDown(self): + MongoClient().drop_database(TEST_DATA_CONTENTSTORE['OPTIONS']['db']) + _CONTENTSTORE.clear() + def load_test_import_course(self): ''' Load the standard course used to test imports (for do_import_static=False behavior).