diff --git a/cms/djangoapps/contentstore/tests/tests.py b/cms/djangoapps/contentstore/tests/tests.py
index 71ded8ff60..d8a9f1b410 100644
--- a/cms/djangoapps/contentstore/tests/tests.py
+++ b/cms/djangoapps/contentstore/tests/tests.py
@@ -202,19 +202,19 @@ class AuthTestCase(ContentStoreTestCase):
for i in range(3):
resp = self._login(self.email, 'wrong_password{0}'.format(i))
- self.assertEqual(resp.status_code, 403)
- self.assertIn(
+ self.assertContains(
+ resp,
'Email or password is incorrect.',
- resp.content
+ status_code=403,
)
# now the account should be locked
resp = self._login(self.email, 'wrong_password')
- self.assertEqual(resp.status_code, 403)
- self.assertIn(
+ self.assertContains(
+ resp,
'This account has been temporarily locked due to excessive login failures.',
- resp.content
+ status_code=403,
)
with freeze_time('2100-01-01'):
@@ -222,10 +222,10 @@ class AuthTestCase(ContentStoreTestCase):
# make sure the failed attempt counter gets reset on successful login
resp = self._login(self.email, 'wrong_password')
- self.assertEqual(resp.status_code, 403)
- self.assertIn(
+ self.assertContains(
+ resp,
'Email or password is incorrect.',
- resp.content
+ status_code=403,
)
# account should not be locked out after just one attempt
diff --git a/common/djangoapps/third_party_auth/tests/specs/base.py b/common/djangoapps/third_party_auth/tests/specs/base.py
index a83af01ac6..a1a54a52bf 100644
--- a/common/djangoapps/third_party_auth/tests/specs/base.py
+++ b/common/djangoapps/third_party_auth/tests/specs/base.py
@@ -121,10 +121,10 @@ class HelperMixin(object):
def assert_json_failure_response_is_missing_social_auth(self, response):
"""Asserts failure on /login for missing social auth looks right."""
- self.assertEqual(403, response.status_code)
- self.assertIn(
+ self.assertContains(
+ response,
u"successfully signed in to your %s account, but this account isn't linked" % self.provider.name,
- response.content.decode(response.charset)
+ status_code=403,
)
def assert_json_failure_response_is_username_collision(self, response):
diff --git a/lms/djangoapps/certificates/tests/test_webview_views.py b/lms/djangoapps/certificates/tests/test_webview_views.py
index 6ee2732072..c00fc7ce40 100644
--- a/lms/djangoapps/certificates/tests/test_webview_views.py
+++ b/lms/djangoapps/certificates/tests/test_webview_views.py
@@ -318,7 +318,6 @@ class CertificatesViewsTests(CommonCertificatesTestCase, CacheIsolationTestCase)
self._add_course_certificates(count=1, signatory_count=1, is_active=True)
test_url = get_certificate_url(course_id=self.cert.course_id, uuid=self.cert.verify_uuid)
response = self.client.get(test_url, HTTP_HOST='test.localhost')
- self.assertEqual(response.status_code, 200)
self.assertContains(response, "Post on Facebook")
self.assertContains(response, 'test_facebook_my_site')
diff --git a/lms/djangoapps/courseware/tests/test_about.py b/lms/djangoapps/courseware/tests/test_about.py
index 4e44338f64..d7a6b03d42 100644
--- a/lms/djangoapps/courseware/tests/test_about.py
+++ b/lms/djangoapps/courseware/tests/test_about.py
@@ -362,7 +362,7 @@ class AboutWithInvitationOnly(SharedModuleStoreTestCase):
self.assertContains(resp, "Enrollment in this course is by invitation only")
# Check that registration button is not present
- self.assertNotContains(response, REG_STR)
+ self.assertNotContains(resp, REG_STR)
def test_invitation_only_but_allowed(self):
"""
@@ -412,14 +412,14 @@ class AboutWithClosedEnrollment(ModuleStoreTestCase):
self.assertContains(resp, "Enrollment is Closed")
# Check that registration button is not present
- self.assertNotContains(response, REG_STR)
+ self.assertNotContains(resp, REG_STR)
def test_course_price_is_not_visble_in_sidebar(self):
url = reverse('about_course', args=[text_type(self.course.id)])
resp = self.client.get(url)
# course price is not visible ihe course_about page when the course
# mode is not set to honor
- self.assertNotContains(response, '$10')
+ self.assertNotContains(resp, '$10')
@ddt.ddt
@@ -461,7 +461,7 @@ class AboutSidebarHTMLTestCase(SharedModuleStoreTestCase):
self.assertContains(resp, '