Always call super(..).setUp() from setUp
This commit is contained in:
@@ -73,6 +73,8 @@ class InstructorTaskModuleSubmitTest(InstructorTaskModuleTestCase):
|
||||
"""Tests API methods that involve the submission of module-based background tasks."""
|
||||
|
||||
def setUp(self):
|
||||
super(InstructorTaskModuleSubmitTest, self).setUp()
|
||||
|
||||
self.initialize_course()
|
||||
self.student = UserFactory.create(username="student", email="student@edx.org")
|
||||
self.instructor = UserFactory.create(username="instructor", email="instructor@edx.org")
|
||||
@@ -164,6 +166,8 @@ class InstructorTaskCourseSubmitTest(TestReportMixin, InstructorTaskCourseTestCa
|
||||
"""Tests API methods that involve the submission of course-based background tasks."""
|
||||
|
||||
def setUp(self):
|
||||
super(InstructorTaskCourseSubmitTest, self).setUp()
|
||||
|
||||
self.initialize_course()
|
||||
self.student = UserFactory.create(username="student", email="student@edx.org")
|
||||
self.instructor = UserFactory.create(username="instructor", email="instructor@edx.org")
|
||||
|
||||
@@ -50,6 +50,8 @@ class InstructorTaskTestCase(TestCase):
|
||||
Tests API and view methods that involve the reporting of status for background tasks.
|
||||
"""
|
||||
def setUp(self):
|
||||
super(InstructorTaskTestCase, self).setUp()
|
||||
|
||||
self.student = UserFactory.create(username="student", email="student@edx.org")
|
||||
self.instructor = UserFactory.create(username="instructor", email="instructor@edx.org")
|
||||
self.problem_url = InstructorTaskTestCase.problem_location("test_urlname")
|
||||
|
||||
@@ -101,6 +101,8 @@ class TestRescoringTask(TestIntegrationTask):
|
||||
"""
|
||||
|
||||
def setUp(self):
|
||||
super(TestRescoringTask, self).setUp()
|
||||
|
||||
self.initialize_course()
|
||||
self.create_instructor('instructor')
|
||||
self.create_student('u1')
|
||||
@@ -374,6 +376,7 @@ class TestResetAttemptsTask(TestIntegrationTask):
|
||||
userlist = ['u1', 'u2', 'u3', 'u4']
|
||||
|
||||
def setUp(self):
|
||||
super(TestResetAttemptsTask, self).setUp()
|
||||
self.initialize_course()
|
||||
self.create_instructor('instructor')
|
||||
for username in self.userlist:
|
||||
@@ -442,6 +445,8 @@ class TestDeleteProblemTask(TestIntegrationTask):
|
||||
userlist = ['u1', 'u2', 'u3', 'u4']
|
||||
|
||||
def setUp(self):
|
||||
super(TestDeleteProblemTask, self).setUp()
|
||||
|
||||
self.initialize_course()
|
||||
self.create_instructor('instructor')
|
||||
for username in self.userlist:
|
||||
|
||||
@@ -28,6 +28,7 @@ class TestInstructorGradeReport(TestReportMixin, InstructorTaskCourseTestCase):
|
||||
Tests that CSV grade report generation works.
|
||||
"""
|
||||
def setUp(self):
|
||||
super(TestInstructorGradeReport, self).setUp()
|
||||
self.course = CourseFactory.create()
|
||||
|
||||
@ddt.data([u'student@example.com', u'ni\xf1o@example.com'])
|
||||
@@ -163,6 +164,7 @@ class TestStudentReport(TestReportMixin, InstructorTaskCourseTestCase):
|
||||
Tests that CSV student profile report generation works.
|
||||
"""
|
||||
def setUp(self):
|
||||
super(TestStudentReport, self).setUp()
|
||||
self.course = CourseFactory.create()
|
||||
|
||||
def test_success(self):
|
||||
@@ -218,6 +220,8 @@ class TestCohortStudents(TestReportMixin, InstructorTaskCourseTestCase):
|
||||
Tests that bulk student cohorting works.
|
||||
"""
|
||||
def setUp(self):
|
||||
super(TestCohortStudents, self).setUp()
|
||||
|
||||
self.course = CourseFactory.create()
|
||||
self.cohort_1 = CohortFactory(course_id=self.course.id, name='Cohort 1')
|
||||
self.cohort_2 = CohortFactory(course_id=self.course.id, name='Cohort 2')
|
||||
|
||||
Reference in New Issue
Block a user