Fix issue with test ordering
The second test here is not idempotent, so we must needs reset the course before each test.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user