From ccefde8d3ce4183c80fa9cab5fe0d5e6b6698134 Mon Sep 17 00:00:00 2001 From: Nimisha Asthagiri Date: Sat, 28 Sep 2019 18:26:08 -0400 Subject: [PATCH] Python-3: assertNotIn(..response.content) -> assertNotContains --- cms/djangoapps/contentstore/tests/tests.py | 4 +-- lms/djangoapps/branding/tests/test_page.py | 6 ++-- .../certificates/tests/test_webview_views.py | 6 ++-- .../courseware/tests/test_date_summary.py | 2 +- lms/djangoapps/courseware/tests/test_views.py | 32 +++++++++---------- .../instructor/tests/test_ecommerce.py | 16 +++++----- lms/djangoapps/instructor/tests/test_email.py | 12 +++---- .../instructor/tests/test_proctoring.py | 2 +- .../tests/views/test_instructor_dashboard.py | 16 +++++----- .../announcements/tests/test_announcements.py | 6 ++-- .../tests/test_course_expiration.py | 8 ++--- .../tests/views/test_course_home.py | 2 +- 12 files changed, 56 insertions(+), 56 deletions(-) diff --git a/cms/djangoapps/contentstore/tests/tests.py b/cms/djangoapps/contentstore/tests/tests.py index 128672b93b..417b69cfdd 100644 --- a/cms/djangoapps/contentstore/tests/tests.py +++ b/cms/djangoapps/contentstore/tests/tests.py @@ -319,7 +319,7 @@ class AuthTestCase(ContentStoreTestCase): is turned off """ response = self.client.get(reverse('homepage')) - self.assertNotIn('Sign Up', response.content) + self.assertNotContains(response, 'Sign Up') @mock.patch.dict(settings.FEATURES, {"ALLOW_PUBLIC_ACCOUNT_CREATION": False}) def test_signup_button_login_page(self): @@ -328,7 +328,7 @@ class AuthTestCase(ContentStoreTestCase): is turned off """ response = self.client.get(reverse('login')) - self.assertNotIn('Sign Up', response.content) + self.assertNotContains(response, 'Sign Up') @mock.patch.dict(settings.FEATURES, {"ALLOW_PUBLIC_ACCOUNT_CREATION": False}) def test_signup_link_login_page(self): diff --git a/lms/djangoapps/branding/tests/test_page.py b/lms/djangoapps/branding/tests/test_page.py index 2b5812388f..6495bcb4c8 100644 --- a/lms/djangoapps/branding/tests/test_page.py +++ b/lms/djangoapps/branding/tests/test_page.py @@ -202,15 +202,15 @@ class IndexPageCourseCardsSortingTests(ModuleStoreTestCase): response = self.client.get('/') self.assertEqual(response.status_code, 200) # assert that the course discovery UI is not present - self.assertNotIn('Search for a course', response.content) + self.assertNotContains(response, 'Search for a course') # check the /courses view response = self.client.get(reverse('courses')) self.assertEqual(response.status_code, 200) # assert that the course discovery UI is not present - self.assertNotIn('Search for a course', response.content) - self.assertNotIn('