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:
@@ -70,7 +70,7 @@ CONTENTSTORE = {
|
||||
'ENGINE': 'xmodule.contentstore.mongo.MongoContentStore',
|
||||
'OPTIONS': {
|
||||
'host': 'localhost',
|
||||
'db': 'xcontent',
|
||||
'db': 'test_xcontent',
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user