diff --git a/cms/djangoapps/contentstore/views/tests/test_certificates.py b/cms/djangoapps/contentstore/views/tests/test_certificates.py index bdd4fe24fe..9f2c54ba58 100644 --- a/cms/djangoapps/contentstore/views/tests/test_certificates.py +++ b/cms/djangoapps/contentstore/views/tests/test_certificates.py @@ -295,8 +295,8 @@ class CertificatesListHandlerTestCase( # in html response result = self.client.get_html(self._url()) - self.assertIn('Test certificate', result.content) - self.assertIn('Test description', result.content) + self.assertContains(result, 'Test certificate') + self.assertContains(result, 'Test description') # in JSON response response = self.client.get_json(self._url()) @@ -320,7 +320,7 @@ class CertificatesListHandlerTestCase( # in html response result = self.client.get_html(self._url()) - self.assertNotIn('Test certificate', result.content) + self.assertNotContains(result, 'Test certificate') def test_unsupported_http_accept_header(self): """ diff --git a/cms/djangoapps/contentstore/views/tests/test_course_updates.py b/cms/djangoapps/contentstore/views/tests/test_course_updates.py index acdfd28b35..98856e6e07 100644 --- a/cms/djangoapps/contentstore/views/tests/test_course_updates.py +++ b/cms/djangoapps/contentstore/views/tests/test_course_updates.py @@ -62,7 +62,7 @@ class CourseUpdateTest(CourseTestCase): # refetch using provided id refetched = self.client.get_json(first_update_url) self.assertHTMLEqual( - content, json.loads(refetched.content)['content'], "get w/ provided id" + content, json.loads(refetched.content.decode('utf-8'))['content'], "get w/ provided id" ) # now put in an evil update diff --git a/cms/djangoapps/contentstore/views/tests/test_gating.py b/cms/djangoapps/contentstore/views/tests/test_gating.py index cc1d96818e..4cf4ddbca7 100644 --- a/cms/djangoapps/contentstore/views/tests/test_gating.py +++ b/cms/djangoapps/contentstore/views/tests/test_gating.py @@ -137,7 +137,7 @@ class TestSubsectionGating(CourseTestCase): {'namespace': '{}{}'.format(six.text_type(self.seq1.location), GATING_NAMESPACE_QUALIFIER)}, {'namespace': '{}{}'.format(six.text_type(self.seq2.location), GATING_NAMESPACE_QUALIFIER)} ] - resp = json.loads(self.client.get_json(self.seq2_url).content) + resp = json.loads(self.client.get_json(self.seq2_url).content.decode('utf-8')) mock_is_prereq.assert_called_with(self.course.id, self.seq2.location) mock_get_required_content.assert_called_with(self.course.id, self.seq2.location) mock_get_prereqs.assert_called_with(self.course.id) diff --git a/cms/djangoapps/contentstore/views/tests/test_import_export.py b/cms/djangoapps/contentstore/views/tests/test_import_export.py index 888eb1809b..0323a6af2d 100644 --- a/cms/djangoapps/contentstore/views/tests/test_import_export.py +++ b/cms/djangoapps/contentstore/views/tests/test_import_export.py @@ -211,7 +211,7 @@ class ImportTestCase(CourseTestCase): Check that the response for a tar.gz import with a course.xml is correct. """ - with open(self.good_tar) as gtar: + with open(self.good_tar, 'rb') as gtar: args = {"name": self.good_tar, "course-data": [gtar]} resp = self.client.post(self.url, args)