From b7674679d9782fdbb4686857a6f32dffd2f69efe Mon Sep 17 00:00:00 2001 From: JonahStanley Date: Tue, 11 Jun 2013 09:18:16 -0400 Subject: [PATCH] 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 --- cms/envs/test.py | 2 +- common/djangoapps/terrain/course_helpers.py | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/cms/envs/test.py b/cms/envs/test.py index 8a3f9ba158..667b9f3555 100644 --- a/cms/envs/test.py +++ b/cms/envs/test.py @@ -70,7 +70,7 @@ CONTENTSTORE = { 'ENGINE': 'xmodule.contentstore.mongo.MongoContentStore', 'OPTIONS': { 'host': 'localhost', - 'db': 'xcontent', + 'db': 'test_xcontent', } } diff --git a/common/djangoapps/terrain/course_helpers.py b/common/djangoapps/terrain/course_helpers.py index cc1f770217..23f932bc3b 100644 --- a/common/djangoapps/terrain/course_helpers.py +++ b/common/djangoapps/terrain/course_helpers.py @@ -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()