Always call super(..).setUp() from setUp

This commit is contained in:
Calen Pennington
2015-01-28 12:05:53 -05:00
parent b1dfac56f0
commit 03a05fd9d4
129 changed files with 371 additions and 32 deletions

View File

@@ -28,6 +28,7 @@ TEST_DATA_MIXED_MODULESTORE = mixed_store_config(TEST_DATA_DIR, TEST_MAPPING)
@patch("openedx.core.djangoapps.course_groups.cohorts.tracker")
class TestCohortSignals(TestCase):
def setUp(self):
super(TestCohortSignals, self).setUp()
self.course_key = SlashSeparatedCourseKey("dummy", "dummy", "dummy")
def test_cohort_added(self, mock_tracker):
@@ -131,7 +132,7 @@ class TestCohorts(TestCase):
"""
Make sure that course is reloaded every time--clear out the modulestore.
"""
clear_existing_modulestores()
super(TestCohorts, self).setUp()
self.toy_course_key = SlashSeparatedCourseKey("edX", "toy", "2012_Fall")
def test_is_course_cohorted(self):
@@ -601,6 +602,8 @@ class TestCohortsAndPartitionGroups(TestCase):
"""
Regenerate a test course and cohorts for each test
"""
super(TestCohortsAndPartitionGroups, self).setUp()
self.test_course_key = SlashSeparatedCourseKey("edX", "toy", "2012_Fall")
self.course = modulestore().get_course(self.test_course_key)

View File

@@ -42,6 +42,8 @@ class TestCohortPartitionScheme(django.test.TestCase):
Regenerate a course with cohort configuration, partition and groups,
and a student for each test.
"""
super(TestCohortPartitionScheme, self).setUp()
self.course_key = SlashSeparatedCourseKey("edX", "toy", "2012_Fall")
self.course = modulestore().get_course(self.course_key)
config_course_cohorts(self.course, [], cohorted=True)
@@ -282,6 +284,7 @@ class TestGetCohortedUserPartition(django.test.TestCase):
Regenerate a course with cohort configuration, partition and groups,
and a student for each test.
"""
super(TestGetCohortedUserPartition, self).setUp()
self.course_key = SlashSeparatedCourseKey("edX", "toy", "2012_Fall")
self.course = modulestore().get_course(self.course_key)
self.student = UserFactory.create()

View File

@@ -35,6 +35,7 @@ class CohortViewsTestCase(ModuleStoreTestCase):
Base class which sets up a course and staff/non-staff users.
"""
def setUp(self):
super(CohortViewsTestCase, self).setUp()
self.course = CourseFactory.create()
self.staff_user = UserFactory(is_staff=True, username="staff")
self.non_staff_user = UserFactory(username="nonstaff")

View File

@@ -51,6 +51,8 @@ class EmailOptInListTest(ModuleStoreTestCase):
DEFAULT_DATETIME_STR = "2014-12-01 00:00:00"
def setUp(self):
super(EmailOptInListTest, self).setUp()
self.user = UserFactory.create(
username=self.USER_USERNAME,
first_name=self.USER_FIRST_NAME,