Commit 775723b9 by John Eskew Committed by Clinton Blackburn

Use ToyCourseFactory instead of the XMLModuleStore-backed toy course.

parent 14a8314a
......@@ -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")
......
......@@ -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()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment