Tests now use their own contentstore database

test.py was changed such that the database being used is test_xcontent
course_helpers.clear_courses now calls contentstore().fs_files.drop() such that all content is removed and the databse is started afresh in the same manner as the modulestore
This commit is contained in:
JonahStanley
2013-06-11 09:18:16 -04:00
parent 271de4fbc9
commit b7674679d9
2 changed files with 3 additions and 1 deletions

View File

@@ -70,7 +70,7 @@ CONTENTSTORE = {
'ENGINE': 'xmodule.contentstore.mongo.MongoContentStore',
'OPTIONS': {
'host': 'localhost',
'db': 'xcontent',
'db': 'test_xcontent',
}
}

View File

@@ -11,6 +11,7 @@ from django.contrib.auth.middleware import AuthenticationMiddleware
from django.contrib.sessions.middleware import SessionMiddleware
from student.models import CourseEnrollment
from xmodule.modulestore.django import _MODULESTORES, modulestore
from xmodule.contentstore.django import contentstore
from xmodule.templates import update_templates
from bs4 import BeautifulSoup
import os.path
@@ -133,3 +134,4 @@ def clear_courses():
_MODULESTORES = {}
modulestore().collection.drop()
update_templates(modulestore('direct'))
contentstore().fs_files.drop()