Commit 7d82f32f by Eric Fischer

Fix issue with test ordering

The second test here is not idempotent, so we must needs reset the
course before each test.
parent fd1ed2ce
......@@ -8,7 +8,6 @@ from lms.djangoapps.instructor.enrollment import reset_student_attempts
from lms.djangoapps.instructor_task.api import submit_rescore_problem_for_student
from mock import patch
from openedx.core.djangolib.testing.utils import get_mock_request
from xmodule.modulestore.django import modulestore
from xmodule.modulestore.tests.django_utils import SharedModuleStoreTestCase
from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory
......@@ -28,8 +27,10 @@ class GradesEventIntegrationTest(ProblemSubmissionTestMixin, SharedModuleStoreTe
of the grading infrastructure.
"""
@classmethod
def setUpClass(cls):
super(GradesEventIntegrationTest, cls).setUpClass()
def reset_course(cls):
"""
Sets up the course anew.
"""
with cls.store.default_store(ModuleStoreEnum.Type.split):
cls.course = CourseFactory.create()
cls.chapter = ItemFactory.create(
......@@ -63,6 +64,7 @@ class GradesEventIntegrationTest(ProblemSubmissionTestMixin, SharedModuleStoreTe
)
def setUp(self):
self.reset_course()
super(GradesEventIntegrationTest, self).setUp()
self.request = get_mock_request(UserFactory())
self.student = self.request.user
......
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