Commit 3fb437e5 by John Eskew

Import test course instead of using XML-backed course.

parent 74eb70aa
...@@ -5,9 +5,11 @@ from django.test.testcases import TestCase ...@@ -5,9 +5,11 @@ from django.test.testcases import TestCase
from nose.plugins.attrib import attr from nose.plugins.attrib import attr
from opaque_keys.edx.keys import CourseKey from opaque_keys.edx.keys import CourseKey
from xmodule.modulestore.tests.django_utils import TEST_DATA_MIXED_TOY_MODULESTORE
import django_comment_common.models as models import django_comment_common.models as models
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase from xmodule.modulestore.tests.django_utils import (
TEST_DATA_MIXED_TOY_MODULESTORE, ModuleStoreTestCase
)
from xmodule.modulestore.tests.factories import ToyCourseFactory
@attr('shard_1') @attr('shard_1')
...@@ -23,7 +25,7 @@ class RoleClassTestCase(ModuleStoreTestCase): ...@@ -23,7 +25,7 @@ class RoleClassTestCase(ModuleStoreTestCase):
# For course ID, syntax edx/classname/classdate is important # For course ID, syntax edx/classname/classdate is important
# because xmodel.course_module.id_to_location looks for a string to split # because xmodel.course_module.id_to_location looks for a string to split
self.course_id = CourseKey.from_string("edX/toy/2012_Fall") self.course_id = ToyCourseFactory.create().id
self.student_role = models.Role.objects.get_or_create(name="Student", self.student_role = models.Role.objects.get_or_create(name="Student",
course_id=self.course_id)[0] course_id=self.course_id)[0]
self.student_role.add_permission("delete_thread") self.student_role.add_permission("delete_thread")
......
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