setUpClassAndTestData is tricker than pylint understands
This commit is contained in:
@@ -402,6 +402,7 @@ class SharedModuleStoreTestCase(
|
||||
Use it like so:
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
# pylint: disable=super-method-not-called
|
||||
with super(MyTestClass, cls).setUpClassAndTestData():
|
||||
<all the cls.setUpClass() setup code that performs modulestore setup...>
|
||||
@classmethod
|
||||
|
||||
@@ -28,6 +28,7 @@ class TestNavigation(SharedModuleStoreTestCase, LoginEnrollmentTestCase):
|
||||
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
# pylint: disable=super-method-not-called
|
||||
with super(TestNavigation, cls).setUpClassAndTestData():
|
||||
cls.test_course = CourseFactory.create()
|
||||
cls.test_course_proctored = CourseFactory.create()
|
||||
|
||||
@@ -2737,6 +2737,7 @@ class TestIndexViewCrawlerStudentStateWrites(SharedModuleStoreTestCase):
|
||||
def setUpClass(cls):
|
||||
"""Set up the simplest course possible."""
|
||||
# setUpClassAndTestData() already calls setUpClass on SharedModuleStoreTestCase
|
||||
# pylint: disable=super-method-not-called
|
||||
with super(TestIndexViewCrawlerStudentStateWrites, cls).setUpClassAndTestData():
|
||||
cls.course = CourseFactory.create()
|
||||
with cls.store.bulk_operations(cls.course.id):
|
||||
|
||||
@@ -1483,6 +1483,7 @@ class InlineDiscussionUnicodeTestCase(ForumsEnableMixin, SharedModuleStoreTestCa
|
||||
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
# pylint: disable=super-method-not-called
|
||||
with super(InlineDiscussionUnicodeTestCase, cls).setUpClassAndTestData():
|
||||
cls.course = CourseFactory.create()
|
||||
|
||||
@@ -1516,6 +1517,7 @@ class ForumFormDiscussionUnicodeTestCase(ForumsEnableMixin, SharedModuleStoreTes
|
||||
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
# pylint: disable=super-method-not-called
|
||||
with super(ForumFormDiscussionUnicodeTestCase, cls).setUpClassAndTestData():
|
||||
cls.course = CourseFactory.create()
|
||||
|
||||
@@ -1605,6 +1607,7 @@ class ForumDiscussionSearchUnicodeTestCase(ForumsEnableMixin, SharedModuleStoreT
|
||||
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
# pylint: disable=super-method-not-called
|
||||
with super(ForumDiscussionSearchUnicodeTestCase, cls).setUpClassAndTestData():
|
||||
cls.course = CourseFactory.create()
|
||||
|
||||
@@ -1641,6 +1644,7 @@ class SingleThreadUnicodeTestCase(ForumsEnableMixin, SharedModuleStoreTestCase,
|
||||
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
# pylint: disable=super-method-not-called
|
||||
with super(SingleThreadUnicodeTestCase, cls).setUpClassAndTestData():
|
||||
cls.course = CourseFactory.create(discussion_topics={'dummy_discussion_id': {'id': 'dummy_discussion_id'}})
|
||||
|
||||
@@ -1674,6 +1678,7 @@ class UserProfileUnicodeTestCase(ForumsEnableMixin, SharedModuleStoreTestCase, U
|
||||
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
# pylint: disable=super-method-not-called
|
||||
with super(UserProfileUnicodeTestCase, cls).setUpClassAndTestData():
|
||||
cls.course = CourseFactory.create()
|
||||
|
||||
@@ -1706,6 +1711,7 @@ class FollowedThreadsUnicodeTestCase(ForumsEnableMixin, SharedModuleStoreTestCas
|
||||
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
# pylint: disable=super-method-not-called
|
||||
with super(FollowedThreadsUnicodeTestCase, cls).setUpClassAndTestData():
|
||||
cls.course = CourseFactory.create()
|
||||
|
||||
|
||||
@@ -438,6 +438,7 @@ class ViewsTestCase(
|
||||
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
# pylint: disable=super-method-not-called
|
||||
with super(ViewsTestCase, cls).setUpClassAndTestData():
|
||||
cls.course = CourseFactory.create(
|
||||
org='MITx', course='999',
|
||||
@@ -1076,6 +1077,7 @@ class ViewPermissionsTestCase(ForumsEnableMixin, UrlResetMixin, SharedModuleStor
|
||||
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
# pylint: disable=super-method-not-called
|
||||
with super(ViewPermissionsTestCase, cls).setUpClassAndTestData():
|
||||
cls.course = CourseFactory.create()
|
||||
|
||||
@@ -1187,6 +1189,7 @@ class CreateThreadUnicodeTestCase(
|
||||
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
# pylint: disable=super-method-not-called
|
||||
with super(CreateThreadUnicodeTestCase, cls).setUpClassAndTestData():
|
||||
cls.course = CourseFactory.create()
|
||||
|
||||
@@ -1229,6 +1232,7 @@ class UpdateThreadUnicodeTestCase(
|
||||
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
# pylint: disable=super-method-not-called
|
||||
with super(UpdateThreadUnicodeTestCase, cls).setUpClassAndTestData():
|
||||
cls.course = CourseFactory.create()
|
||||
|
||||
@@ -1271,6 +1275,7 @@ class CreateCommentUnicodeTestCase(
|
||||
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
# pylint: disable=super-method-not-called
|
||||
with super(CreateCommentUnicodeTestCase, cls).setUpClassAndTestData():
|
||||
cls.course = CourseFactory.create()
|
||||
|
||||
@@ -1318,6 +1323,7 @@ class UpdateCommentUnicodeTestCase(
|
||||
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
# pylint: disable=super-method-not-called
|
||||
with super(UpdateCommentUnicodeTestCase, cls).setUpClassAndTestData():
|
||||
cls.course = CourseFactory.create()
|
||||
|
||||
@@ -1358,6 +1364,7 @@ class CreateSubCommentUnicodeTestCase(
|
||||
"""
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
# pylint: disable=super-method-not-called
|
||||
with super(CreateSubCommentUnicodeTestCase, cls).setUpClassAndTestData():
|
||||
cls.course = CourseFactory.create()
|
||||
|
||||
@@ -1439,6 +1446,7 @@ class TeamsPermissionsTestCase(ForumsEnableMixin, UrlResetMixin, SharedModuleSto
|
||||
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
# pylint: disable=super-method-not-called
|
||||
with super(TeamsPermissionsTestCase, cls).setUpClassAndTestData():
|
||||
teams_configuration = {
|
||||
'topics': [{'id': "topic_id", 'name': 'Solar Power', 'description': 'Solar power is hot'}]
|
||||
@@ -1749,6 +1757,7 @@ class ForumEventTestCase(ForumsEnableMixin, SharedModuleStoreTestCase, MockReque
|
||||
"""
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
# pylint: disable=super-method-not-called
|
||||
with super(ForumEventTestCase, cls).setUpClassAndTestData():
|
||||
cls.course = CourseFactory.create()
|
||||
|
||||
@@ -1930,6 +1939,7 @@ class UsersEndpointTestCase(ForumsEnableMixin, SharedModuleStoreTestCase, MockRe
|
||||
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
# pylint: disable=super-method-not-called
|
||||
with super(UsersEndpointTestCase, cls).setUpClassAndTestData():
|
||||
cls.course = CourseFactory.create()
|
||||
|
||||
|
||||
@@ -201,6 +201,7 @@ class TeamAPITestCase(APITestCase, SharedModuleStoreTestCase):
|
||||
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
# pylint: disable=super-method-not-called
|
||||
with super(TeamAPITestCase, cls).setUpClassAndTestData():
|
||||
teams_configuration_1 = {
|
||||
'topics':
|
||||
|
||||
@@ -22,6 +22,7 @@ class TestCourseBookmarksTool(SharedModuleStoreTestCase):
|
||||
"""
|
||||
Set up a course to be used for testing.
|
||||
"""
|
||||
# pylint: disable=super-method-not-called
|
||||
with super(TestCourseBookmarksTool, cls).setUpClassAndTestData():
|
||||
with cls.store.default_store(ModuleStoreEnum.Type.split):
|
||||
cls.course = CourseFactory.create()
|
||||
|
||||
@@ -92,6 +92,7 @@ class CourseHomePageTestCase(SharedModuleStoreTestCase):
|
||||
"""
|
||||
Set up a course to be used for testing.
|
||||
"""
|
||||
# pylint: disable=super-method-not-called
|
||||
with super(CourseHomePageTestCase, cls).setUpClassAndTestData():
|
||||
with cls.store.default_store(ModuleStoreEnum.Type.split):
|
||||
cls.course = CourseFactory.create(
|
||||
|
||||
@@ -49,6 +49,7 @@ class TestCourseOutlinePage(SharedModuleStoreTestCase):
|
||||
Set up an array of various courses to be tested.
|
||||
"""
|
||||
# setUpClassAndTestData() already calls setUpClass on SharedModuleStoreTestCase
|
||||
# pylint: disable=super-method-not-called
|
||||
with super(TestCourseOutlinePage, cls).setUpClassAndTestData():
|
||||
cls.courses = []
|
||||
course = CourseFactory.create()
|
||||
@@ -145,6 +146,7 @@ class TestCourseOutlinePageWithPrerequisites(SharedModuleStoreTestCase, Mileston
|
||||
"""
|
||||
Creates a test course that can be used for non-destructive tests
|
||||
"""
|
||||
# pylint: disable=super-method-not-called
|
||||
|
||||
cls.PREREQ_REQUIRED = '(Prerequisite required)'
|
||||
cls.UNLOCKED = 'Unlocked'
|
||||
@@ -297,6 +299,7 @@ class TestCourseOutlineResumeCourse(SharedModuleStoreTestCase, CompletionWaffleT
|
||||
Creates a test course that can be used for non-destructive tests
|
||||
"""
|
||||
# setUpClassAndTestData() already calls setUpClass on SharedModuleStoreTestCase
|
||||
# pylint: disable=super-method-not-called
|
||||
with super(TestCourseOutlineResumeCourse, cls).setUpClassAndTestData():
|
||||
cls.course = cls.create_test_course()
|
||||
|
||||
|
||||
@@ -83,6 +83,7 @@ class TestCourseUpdatesPage(SharedModuleStoreTestCase):
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
"""Set up the simplest course possible."""
|
||||
# pylint: disable=super-method-not-called
|
||||
with super(TestCourseUpdatesPage, cls).setUpClassAndTestData():
|
||||
with cls.store.default_store(ModuleStoreEnum.Type.split):
|
||||
cls.course = CourseFactory.create()
|
||||
|
||||
Reference in New Issue
Block a user