Commit 509a8614 by Julian Arni

Clear contentstore

Signed-off-by: Julian Arni <julian@edx.org>
parent a28b02ae
...@@ -5,13 +5,21 @@ import os ...@@ -5,13 +5,21 @@ import os
import shutil import shutil
import tarfile import tarfile
import tempfile import tempfile
import copy
from uuid import uuid4
from pymongo import MongoClient
from .utils import CourseTestCase from .utils import CourseTestCase
from django.core.urlresolvers import reverse from django.core.urlresolvers import reverse
from django.test.utils import override_settings
from django.conf import settings
from xmodule.modulestore import Location from xmodule.contentstore.django import _CONTENTSTORE
from contentstore.views import import_export
TEST_DATA_CONTENTSTORE = copy.deepcopy(settings.CONTENTSTORE)
TEST_DATA_CONTENTSTORE['OPTIONS']['db'] = 'test_xcontent_%s' % uuid4().hex
@override_settings(CONTENTSTORE=TEST_DATA_CONTENTSTORE)
class ImportTestCase(CourseTestCase): class ImportTestCase(CourseTestCase):
""" """
Unit tests for importing a course Unit tests for importing a course
...@@ -54,6 +62,8 @@ class ImportTestCase(CourseTestCase): ...@@ -54,6 +62,8 @@ class ImportTestCase(CourseTestCase):
def tearDown(self): def tearDown(self):
shutil.rmtree(self.content_dir) shutil.rmtree(self.content_dir)
MongoClient().drop_database(TEST_DATA_CONTENTSTORE['OPTIONS']['db'])
_CONTENTSTORE.clear()
def test_no_coursexml(self): def test_no_coursexml(self):
""" """
......
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