Python 3: multi-lined assertIn, assertNotIn -> assertContains, assertNotContains
This commit is contained in:
@@ -349,10 +349,10 @@ class BulkEnrollmentTest(ModuleStoreTestCase, LoginEnrollmentTestCase, APITestCa
|
||||
'courses': self.course_key,
|
||||
'cohorts': "cohort1,cohort2"
|
||||
})
|
||||
self.assertEqual(response.status_code, 400)
|
||||
self.assertIn(
|
||||
self.assertContains(
|
||||
response,
|
||||
'If provided, the cohorts and courses should have equal number of items.',
|
||||
response.content.decode('utf-8')
|
||||
status_code=400,
|
||||
)
|
||||
|
||||
def test_fail_on_missing_cohorts(self):
|
||||
@@ -366,10 +366,13 @@ class BulkEnrollmentTest(ModuleStoreTestCase, LoginEnrollmentTestCase, APITestCa
|
||||
'cohorts': 'cohort1',
|
||||
'courses': self.course_key
|
||||
})
|
||||
self.assertEqual(response.status_code, 400)
|
||||
self.assertIn(u'cohort {cohort_name} not found in course {course_id}.'.format(
|
||||
cohort_name='cohort1', course_id=self.course_key
|
||||
), response.content.decode('utf-8'))
|
||||
self.assertContains(
|
||||
response,
|
||||
u'cohort {cohort_name} not found in course {course_id}.'.format(
|
||||
cohort_name='cohort1', course_id=self.course_key
|
||||
),
|
||||
status_code=400,
|
||||
)
|
||||
|
||||
def test_allow_cohorts_when_enrolling(self):
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user