Unify usage of a single test mixed modulestore called:
TEST_DATA_MIXED_MODULESTORE Remove these test mixed modulestores: TEST_DATA_MIXED_TOY_MODULESTORE TEST_DATA_MIXED_CLOSED_MODULESTORE TEST_DATA_MIXED_GRADED_MODULESTORE
This commit is contained in:
committed by
Clinton Blackburn
parent
7aa3ee8df9
commit
2380fa3c2c
@@ -13,7 +13,7 @@ from opaque_keys.edx.locations import SlashSeparatedCourseKey
|
||||
|
||||
from student.tests.factories import UserFactory, CourseEnrollmentFactory
|
||||
from xmodule.modulestore.tests.django_utils import SharedModuleStoreTestCase
|
||||
from xmodule.modulestore.tests.django_utils import TEST_DATA_MIXED_TOY_MODULESTORE
|
||||
from xmodule.modulestore.tests.django_utils import TEST_DATA_MIXED_MODULESTORE
|
||||
from xmodule.modulestore.tests.factories import CourseFactory
|
||||
|
||||
# This import is for an lms djangoapp.
|
||||
@@ -90,7 +90,7 @@ class TestStudentDashboardEmailViewXMLBacked(SharedModuleStoreTestCase):
|
||||
"""
|
||||
Check for email view on student dashboard, with XML backed course.
|
||||
"""
|
||||
MODULESTORE = TEST_DATA_MIXED_TOY_MODULESTORE
|
||||
MODULESTORE = TEST_DATA_MIXED_MODULESTORE
|
||||
|
||||
def setUp(self):
|
||||
super(TestStudentDashboardEmailViewXMLBacked, self).setUp()
|
||||
|
||||
@@ -147,22 +147,14 @@ def drop_mongo_collections(mock_create):
|
||||
|
||||
TEST_DATA_DIR = settings.COMMON_TEST_DATA_ROOT
|
||||
|
||||
# This modulestore will provide both a mixed mongo editable modulestore, and
|
||||
# an XML store with just the toy course loaded.
|
||||
TEST_DATA_MIXED_TOY_MODULESTORE = mixed_store_config(
|
||||
TEST_DATA_DIR, {}, xml_source_dirs=['toy']
|
||||
)
|
||||
|
||||
# This modulestore will provide both a mixed mongo editable modulestore, and
|
||||
# an XML store with common/test/data/2014 loaded, which is a course that is closed.
|
||||
TEST_DATA_MIXED_CLOSED_MODULESTORE = mixed_store_config(
|
||||
TEST_DATA_DIR, {}, xml_source_dirs=['2014']
|
||||
)
|
||||
|
||||
# This modulestore will provide both a mixed mongo editable modulestore, and
|
||||
# an XML store with common/test/data/graded loaded, which is a course that is graded.
|
||||
TEST_DATA_MIXED_GRADED_MODULESTORE = mixed_store_config(
|
||||
TEST_DATA_DIR, {}, xml_source_dirs=['graded']
|
||||
# This modulestore will provide a mixed mongo editable modulestore.
|
||||
# If your test uses the 'toy' course, use the the ToyCourseFactory to construct it.
|
||||
# If your test needs a closed course to test against, import the common/test/data/2014
|
||||
# test course into this modulestore.
|
||||
# If your test needs a graded course to test against, import the common/test/data/graded
|
||||
# test course into this modulestore.
|
||||
TEST_DATA_MIXED_MODULESTORE = mixed_store_config(
|
||||
TEST_DATA_DIR, {}
|
||||
)
|
||||
|
||||
# All store requests now go through mixed
|
||||
|
||||
@@ -8,7 +8,6 @@ from nose.plugins.attrib import attr
|
||||
|
||||
from bulk_email.models import CourseAuthorization, CourseEmailTemplate
|
||||
from bulk_email.forms import CourseAuthorizationAdminForm, CourseEmailTemplateForm
|
||||
from xmodule.modulestore.tests.django_utils import TEST_DATA_MIXED_TOY_MODULESTORE
|
||||
from opaque_keys.edx.locations import SlashSeparatedCourseKey
|
||||
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
|
||||
from xmodule.modulestore.tests.factories import CourseFactory
|
||||
|
||||
@@ -14,7 +14,7 @@ from opaque_keys.edx.locations import SlashSeparatedCourseKey
|
||||
|
||||
from course_modes.models import CourseMode
|
||||
from track.tests import EventTrackingTestCase
|
||||
from xmodule.modulestore.tests.django_utils import TEST_DATA_MIXED_CLOSED_MODULESTORE
|
||||
from xmodule.modulestore.tests.django_utils import TEST_DATA_MIXED_MODULESTORE
|
||||
from xmodule.modulestore.tests.utils import TEST_DATA_DIR
|
||||
from xmodule.modulestore.xml_importer import import_course_from_xml
|
||||
|
||||
@@ -201,7 +201,7 @@ class AboutTestCaseXML(LoginEnrollmentTestCase, ModuleStoreTestCase):
|
||||
"""
|
||||
Tests for the course about page
|
||||
"""
|
||||
MODULESTORE = TEST_DATA_MIXED_CLOSED_MODULESTORE
|
||||
MODULESTORE = TEST_DATA_MIXED_MODULESTORE
|
||||
|
||||
def setUp(self):
|
||||
"""
|
||||
|
||||
@@ -18,7 +18,7 @@ from xmodule.modulestore.tests.django_utils import (
|
||||
ModuleStoreTestCase,
|
||||
SharedModuleStoreTestCase,
|
||||
TEST_DATA_SPLIT_MODULESTORE,
|
||||
TEST_DATA_MIXED_CLOSED_MODULESTORE
|
||||
TEST_DATA_MIXED_MODULESTORE
|
||||
)
|
||||
from xmodule.modulestore.tests.utils import TEST_DATA_DIR
|
||||
from xmodule.modulestore.xml_importer import import_course_from_xml
|
||||
@@ -214,7 +214,7 @@ class CourseInfoTestCaseXML(LoginEnrollmentTestCase, ModuleStoreTestCase):
|
||||
"""
|
||||
Tests for the Course Info page for an XML course
|
||||
"""
|
||||
MODULESTORE = TEST_DATA_MIXED_CLOSED_MODULESTORE
|
||||
MODULESTORE = TEST_DATA_MIXED_MODULESTORE
|
||||
|
||||
def setUp(self):
|
||||
"""
|
||||
|
||||
@@ -309,7 +309,7 @@ class CoursesRenderTest(ModuleStoreTestCase):
|
||||
@attr('shard_1')
|
||||
class XmlCoursesRenderTest(ModuleStoreTestCase):
|
||||
"""Test methods related to rendering courses content for an XML course."""
|
||||
MODULESTORE = TEST_DATA_MIXED_TOY_MODULESTORE
|
||||
MODULESTORE = TEST_DATA_MIXED_MODULESTORE
|
||||
|
||||
def setUp(self):
|
||||
"""
|
||||
|
||||
@@ -43,13 +43,13 @@ from openedx.core.lib.courses import course_image_url
|
||||
from openedx.core.lib.gating import api as gating_api
|
||||
from student.models import anonymous_id_for_user
|
||||
from xmodule.modulestore.tests.django_utils import (
|
||||
TEST_DATA_MIXED_TOY_MODULESTORE,
|
||||
SharedModuleStoreTestCase
|
||||
ModuleStoreTestCase,
|
||||
SharedModuleStoreTestCase,
|
||||
TEST_DATA_MIXED_MODULESTORE
|
||||
)
|
||||
from xmodule.lti_module import LTIDescriptor
|
||||
from xmodule.modulestore import ModuleStoreEnum
|
||||
from xmodule.modulestore.django import modulestore
|
||||
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
|
||||
from xmodule.modulestore.tests.factories import ItemFactory, CourseFactory, ToyCourseFactory, check_mongo_calls
|
||||
from xmodule.x_module import XModuleDescriptor, XModule, STUDENT_VIEW, CombinedSystem
|
||||
|
||||
@@ -1403,7 +1403,7 @@ class MongoViewInStudioTest(ViewInStudioTest):
|
||||
class MixedViewInStudioTest(ViewInStudioTest):
|
||||
"""Test the 'View in Studio' link visibility in a mixed mongo backed course."""
|
||||
|
||||
MODULESTORE = TEST_DATA_MIXED_TOY_MODULESTORE
|
||||
MODULESTORE = TEST_DATA_MIXED_MODULESTORE
|
||||
|
||||
def test_view_in_studio_link_mongo_backed(self):
|
||||
"""Mixed mongo courses that are mongo backed should see 'View in Studio' links."""
|
||||
|
||||
@@ -29,7 +29,8 @@ from milestones.tests.utils import MilestonesTestCaseMixin
|
||||
from xmodule import tabs as xmodule_tabs
|
||||
from xmodule.modulestore.tests.django_utils import (
|
||||
ModuleStoreTestCase,
|
||||
SharedModuleStoreTestCase
|
||||
SharedModuleStoreTestCase,
|
||||
TEST_DATA_MIXED_MODULESTORE
|
||||
)
|
||||
from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory
|
||||
from xmodule.modulestore.tests.utils import TEST_DATA_DIR
|
||||
@@ -228,7 +229,7 @@ class TextbooksTestCase(TabTestCase):
|
||||
class StaticTabDateTestCase(LoginEnrollmentTestCase, SharedModuleStoreTestCase):
|
||||
"""Test cases for Static Tab Dates."""
|
||||
|
||||
MODULESTORE = TEST_DATA_MIXED_TOY_MODULESTORE
|
||||
MODULESTORE = TEST_DATA_MIXED_MODULESTORE
|
||||
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
@@ -288,7 +289,7 @@ class StaticTabDateTestCaseXML(LoginEnrollmentTestCase, ModuleStoreTestCase):
|
||||
Tests for the static tab dates of an XML course
|
||||
"""
|
||||
|
||||
MODULESTORE = TEST_DATA_MIXED_CLOSED_MODULESTORE
|
||||
MODULESTORE = TEST_DATA_MIXED_MODULESTORE
|
||||
|
||||
def setUp(self):
|
||||
"""
|
||||
@@ -338,7 +339,7 @@ class EntranceExamsTabsTestCase(LoginEnrollmentTestCase, ModuleStoreTestCase, Mi
|
||||
"""
|
||||
Validate tab behavior when dealing with Entrance Exams
|
||||
"""
|
||||
MODULESTORE = TEST_DATA_MIXED_CLOSED_MODULESTORE
|
||||
MODULESTORE = TEST_DATA_MIXED_MODULESTORE
|
||||
|
||||
@patch.dict('django.conf.settings.FEATURES', {'ENTRANCE_EXAMS': True, 'MILESTONES_APP': True})
|
||||
def setUp(self):
|
||||
@@ -445,7 +446,7 @@ class TextBookCourseViewsTestCase(LoginEnrollmentTestCase, SharedModuleStoreTest
|
||||
"""
|
||||
Validate tab behavior when dealing with textbooks.
|
||||
"""
|
||||
MODULESTORE = TEST_DATA_MIXED_TOY_MODULESTORE
|
||||
MODULESTORE = TEST_DATA_MIXED_MODULESTORE
|
||||
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
|
||||
@@ -51,7 +51,7 @@ from util.url import reload_django_url_config
|
||||
from util.views import ensure_valid_course_key
|
||||
from xmodule.modulestore import ModuleStoreEnum
|
||||
from xmodule.modulestore.django import modulestore
|
||||
from xmodule.modulestore.tests.django_utils import TEST_DATA_MIXED_TOY_MODULESTORE
|
||||
from xmodule.modulestore.tests.django_utils import TEST_DATA_MIXED_MODULESTORE
|
||||
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
|
||||
from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory, check_mongo_calls
|
||||
from openedx.core.djangoapps.credit.api import set_credit_requirements
|
||||
@@ -63,7 +63,7 @@ class TestJumpTo(ModuleStoreTestCase):
|
||||
"""
|
||||
Check the jumpto link for a course.
|
||||
"""
|
||||
MODULESTORE = TEST_DATA_MIXED_TOY_MODULESTORE
|
||||
MODULESTORE = TEST_DATA_MIXED_MODULESTORE
|
||||
|
||||
def setUp(self):
|
||||
super(TestJumpTo, self).setUp()
|
||||
|
||||
@@ -14,7 +14,7 @@ from lms.djangoapps.lms_xblock.field_data import LmsFieldData
|
||||
from xmodule.error_module import ErrorDescriptor
|
||||
from xmodule.modulestore.django import modulestore
|
||||
from xmodule.modulestore.tests.django_utils import (
|
||||
ModuleStoreTestCase, TEST_DATA_MIXED_TOY_MODULESTORE
|
||||
ModuleStoreTestCase, TEST_DATA_MIXED_MODULESTORE
|
||||
)
|
||||
from xmodule.modulestore.tests.factories import ToyCourseFactory
|
||||
|
||||
@@ -128,7 +128,7 @@ class TestMongoCoursesLoad(ModuleStoreTestCase, PageLoaderTestCase):
|
||||
"""
|
||||
Check that all pages in test courses load properly from Mongo.
|
||||
"""
|
||||
MODULESTORE = TEST_DATA_MIXED_TOY_MODULESTORE
|
||||
MODULESTORE = TEST_DATA_MIXED_MODULESTORE
|
||||
|
||||
def setUp(self):
|
||||
super(TestMongoCoursesLoad, self).setUp()
|
||||
|
||||
@@ -7,7 +7,7 @@ from opaque_keys.edx.keys import CourseKey
|
||||
|
||||
import django_comment_common.models as models
|
||||
from xmodule.modulestore.tests.django_utils import (
|
||||
TEST_DATA_MIXED_TOY_MODULESTORE, ModuleStoreTestCase
|
||||
TEST_DATA_MIXED_MODULESTORE, ModuleStoreTestCase
|
||||
)
|
||||
from xmodule.modulestore.tests.factories import ToyCourseFactory
|
||||
|
||||
@@ -17,7 +17,7 @@ class RoleClassTestCase(ModuleStoreTestCase):
|
||||
"""
|
||||
Tests for roles of the comment client service integration
|
||||
"""
|
||||
MODULESTORE = TEST_DATA_MIXED_TOY_MODULESTORE
|
||||
MODULESTORE = TEST_DATA_MIXED_MODULESTORE
|
||||
|
||||
def setUp(self):
|
||||
super(RoleClassTestCase, self).setUp()
|
||||
|
||||
@@ -26,7 +26,7 @@ from openedx.core.djangoapps.util.testing import ContentGroupTestCase
|
||||
from student.roles import CourseStaffRole
|
||||
from xmodule.modulestore import ModuleStoreEnum
|
||||
from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory, ToyCourseFactory
|
||||
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase, TEST_DATA_MIXED_TOY_MODULESTORE
|
||||
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase, TEST_DATA_MIXED_MODULESTORE
|
||||
from xmodule.modulestore.django import modulestore
|
||||
from opaque_keys.edx.locator import CourseLocator
|
||||
from lms.djangoapps.teams.tests.factories import CourseTeamFactory
|
||||
@@ -1248,7 +1248,7 @@ class IsCommentableCohortedTestCase(ModuleStoreTestCase):
|
||||
Test the is_commentable_cohorted function.
|
||||
"""
|
||||
|
||||
MODULESTORE = TEST_DATA_MIXED_TOY_MODULESTORE
|
||||
MODULESTORE = TEST_DATA_MIXED_MODULESTORE
|
||||
|
||||
def setUp(self):
|
||||
"""
|
||||
|
||||
@@ -12,7 +12,7 @@ from opaque_keys.edx.locations import SlashSeparatedCourseKey
|
||||
|
||||
from bulk_email.models import CourseAuthorization
|
||||
from xmodule.modulestore.tests.django_utils import (
|
||||
TEST_DATA_MIXED_TOY_MODULESTORE, SharedModuleStoreTestCase
|
||||
TEST_DATA_MIXED_MODULESTORE, SharedModuleStoreTestCase
|
||||
)
|
||||
from student.tests.factories import AdminFactory
|
||||
from xmodule.modulestore.tests.factories import CourseFactory
|
||||
@@ -112,7 +112,7 @@ class TestNewInstructorDashboardEmailViewXMLBacked(SharedModuleStoreTestCase):
|
||||
Check for email view on the new instructor dashboard
|
||||
"""
|
||||
|
||||
MODULESTORE = TEST_DATA_MIXED_TOY_MODULESTORE
|
||||
MODULESTORE = TEST_DATA_MIXED_MODULESTORE
|
||||
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
|
||||
@@ -6,7 +6,7 @@ import ddt
|
||||
from xblock.validation import ValidationMessage
|
||||
from xmodule.modulestore import ModuleStoreEnum
|
||||
from xmodule.modulestore.tests.factories import CourseFactory, ToyCourseFactory, ItemFactory
|
||||
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase, TEST_DATA_MIXED_TOY_MODULESTORE
|
||||
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase, TEST_DATA_MIXED_MODULESTORE
|
||||
from xmodule.partitions.partitions import Group, UserPartition
|
||||
|
||||
|
||||
@@ -157,7 +157,7 @@ class XBlockGetParentTest(LmsXBlockMixinTestCase):
|
||||
Test that XBlock.get_parent returns correct results with each modulestore
|
||||
backend.
|
||||
"""
|
||||
MODULESTORE = TEST_DATA_MIXED_TOY_MODULESTORE
|
||||
MODULESTORE = TEST_DATA_MIXED_MODULESTORE
|
||||
|
||||
@ddt.data(ModuleStoreEnum.Type.mongo, ModuleStoreEnum.Type.split, ModuleStoreEnum.Type.xml)
|
||||
def test_parents(self, modulestore_type):
|
||||
|
||||
@@ -16,7 +16,7 @@ from opaque_keys.edx.locations import SlashSeparatedCourseKey
|
||||
from student.models import CourseEnrollment
|
||||
from student.tests.factories import UserFactory
|
||||
from xmodule.modulestore.django import modulestore
|
||||
from xmodule.modulestore.tests.django_utils import TEST_DATA_MIXED_TOY_MODULESTORE, ModuleStoreTestCase
|
||||
from xmodule.modulestore.tests.django_utils import TEST_DATA_MIXED_MODULESTORE, ModuleStoreTestCase
|
||||
from xmodule.modulestore.tests.factories import ToyCourseFactory
|
||||
|
||||
from ..models import CourseUserGroup, CourseCohort, CourseUserGroupPartitionGroup
|
||||
@@ -139,7 +139,7 @@ class TestCohorts(ModuleStoreTestCase):
|
||||
"""
|
||||
Test the cohorts feature
|
||||
"""
|
||||
MODULESTORE = TEST_DATA_MIXED_TOY_MODULESTORE
|
||||
MODULESTORE = TEST_DATA_MIXED_MODULESTORE
|
||||
|
||||
def setUp(self):
|
||||
"""
|
||||
@@ -733,7 +733,7 @@ class TestCohortsAndPartitionGroups(ModuleStoreTestCase):
|
||||
"""
|
||||
Test Cohorts and Partitions Groups.
|
||||
"""
|
||||
MODULESTORE = TEST_DATA_MIXED_TOY_MODULESTORE
|
||||
MODULESTORE = TEST_DATA_MIXED_MODULESTORE
|
||||
|
||||
def setUp(self):
|
||||
"""
|
||||
|
||||
@@ -15,7 +15,7 @@ from courseware.tests.test_masquerade import StaffMasqueradeTestCase
|
||||
from student.tests.factories import UserFactory
|
||||
from xmodule.partitions.partitions import Group, UserPartition, UserPartitionError
|
||||
from xmodule.modulestore.django import modulestore
|
||||
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase, TEST_DATA_MIXED_TOY_MODULESTORE
|
||||
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase, TEST_DATA_MIXED_MODULESTORE
|
||||
from xmodule.modulestore.tests.factories import ToyCourseFactory
|
||||
from opaque_keys.edx.locations import SlashSeparatedCourseKey
|
||||
|
||||
@@ -32,7 +32,7 @@ class TestCohortPartitionScheme(ModuleStoreTestCase):
|
||||
"""
|
||||
Test the logic for linking a user to a partition group based on their cohort.
|
||||
"""
|
||||
MODULESTORE = TEST_DATA_MIXED_TOY_MODULESTORE
|
||||
MODULESTORE = TEST_DATA_MIXED_MODULESTORE
|
||||
|
||||
def setUp(self):
|
||||
"""
|
||||
@@ -279,7 +279,7 @@ class TestGetCohortedUserPartition(ModuleStoreTestCase):
|
||||
"""
|
||||
Test that `get_cohorted_user_partition` returns the first user_partition with scheme `CohortPartitionScheme`.
|
||||
"""
|
||||
MODULESTORE = TEST_DATA_MIXED_TOY_MODULESTORE
|
||||
MODULESTORE = TEST_DATA_MIXED_MODULESTORE
|
||||
|
||||
def setUp(self):
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user