From 4221ca6f2a32aca100a04c4fd555aa194067abdb Mon Sep 17 00:00:00 2001 From: John Eskew Date: Tue, 22 Dec 2015 10:18:10 -0500 Subject: [PATCH] Use ToyCourseFactory instead of the XMLModuleStore-backed toy course. --- openedx/core/djangoapps/course_groups/tests/test_cohorts.py | 5 +++-- .../djangoapps/course_groups/tests/test_partition_scheme.py | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/openedx/core/djangoapps/course_groups/tests/test_cohorts.py b/openedx/core/djangoapps/course_groups/tests/test_cohorts.py index 1a0986df9c..0e5f23a033 100644 --- a/openedx/core/djangoapps/course_groups/tests/test_cohorts.py +++ b/openedx/core/djangoapps/course_groups/tests/test_cohorts.py @@ -17,6 +17,7 @@ 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.factories import ToyCourseFactory from ..models import CourseUserGroup, CourseCohort, CourseUserGroupPartitionGroup from .. import cohorts @@ -145,7 +146,7 @@ class TestCohorts(ModuleStoreTestCase): Make sure that course is reloaded every time--clear out the modulestore. """ super(TestCohorts, self).setUp() - self.toy_course_key = SlashSeparatedCourseKey("edX", "toy", "2012_Fall") + self.toy_course_key = ToyCourseFactory.create().id def _create_cohort(self, course_id, cohort_name, assignment_type): """ @@ -740,7 +741,7 @@ class TestCohortsAndPartitionGroups(ModuleStoreTestCase): """ super(TestCohortsAndPartitionGroups, self).setUp() - self.test_course_key = SlashSeparatedCourseKey("edX", "toy", "2012_Fall") + self.test_course_key = ToyCourseFactory.create().id self.course = modulestore().get_course(self.test_course_key) self.first_cohort = CohortFactory(course_id=self.course.id, name="FirstCohort") diff --git a/openedx/core/djangoapps/course_groups/tests/test_partition_scheme.py b/openedx/core/djangoapps/course_groups/tests/test_partition_scheme.py index df76894633..f76d1ebec8 100644 --- a/openedx/core/djangoapps/course_groups/tests/test_partition_scheme.py +++ b/openedx/core/djangoapps/course_groups/tests/test_partition_scheme.py @@ -16,6 +16,7 @@ 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.factories import ToyCourseFactory from opaque_keys.edx.locations import SlashSeparatedCourseKey from openedx.core.djangoapps.user_api.partition_schemes import RandomUserPartitionScheme @@ -40,7 +41,7 @@ class TestCohortPartitionScheme(ModuleStoreTestCase): """ super(TestCohortPartitionScheme, self).setUp() - self.course_key = SlashSeparatedCourseKey("edX", "toy", "2012_Fall") + self.course_key = ToyCourseFactory.create().id self.course = modulestore().get_course(self.course_key) config_course_cohorts(self.course, is_cohorted=True) @@ -286,7 +287,7 @@ class TestGetCohortedUserPartition(ModuleStoreTestCase): and a student for each test. """ super(TestGetCohortedUserPartition, self).setUp() - self.course_key = SlashSeparatedCourseKey("edX", "toy", "2012_Fall") + self.course_key = ToyCourseFactory.create().id self.course = modulestore().get_course(self.course_key) self.student = UserFactory.create()