diff --git a/cms/djangoapps/contentstore/tests/test_export_git.py b/cms/djangoapps/contentstore/tests/test_export_git.py index 27ae16da16..9b9c58b54b 100644 --- a/cms/djangoapps/contentstore/tests/test_export_git.py +++ b/cms/djangoapps/contentstore/tests/test_export_git.py @@ -69,7 +69,7 @@ class TestExportGit(CourseTestCase): self.assertIn( ('giturl must be defined in your ' 'course settings before you can export to git.'), - response.content + response.content.decode('utf-8') ) response = self.client.get('{}?action=push'.format(self.test_url)) @@ -77,7 +77,7 @@ class TestExportGit(CourseTestCase): self.assertIn( ('giturl must be defined in your ' 'course settings before you can export to git.'), - response.content + response.content.decode('utf-8') ) def test_course_export_failures(self): @@ -88,7 +88,7 @@ class TestExportGit(CourseTestCase): modulestore().update_item(self.course_module, self.user.id) response = self.client.get('{}?action=push'.format(self.test_url)) - self.assertIn('Export Failed:', response.content) + self.assertIn('Export Failed:', response.content.decode('utf-8')) def test_exception_translation(self): """ @@ -98,7 +98,7 @@ class TestExportGit(CourseTestCase): modulestore().update_item(self.course_module, self.user.id) response = self.client.get('{}?action=push'.format(self.test_url)) - self.assertNotIn('django.utils.functional.__proxy__', response.content) + self.assertNotIn('django.utils.functional.__proxy__', response.content.decode('utf-8')) def test_course_export_success(self): """ @@ -107,7 +107,7 @@ class TestExportGit(CourseTestCase): self.make_bare_repo_with_course('test_repo') response = self.client.get('{}?action=push'.format(self.test_url)) - self.assertIn('Export Succeeded', response.content) + self.assertIn('Export Succeeded', response.content.decode('utf-8')) def test_repo_with_dots(self): """ @@ -115,7 +115,7 @@ class TestExportGit(CourseTestCase): """ self.make_bare_repo_with_course('test.repo') response = self.client.get('{}?action=push'.format(self.test_url)) - self.assertIn('Export Succeeded', response.content) + self.assertIn('Export Succeeded', response.content.decode('utf-8')) def test_dirty_repo(self): """ diff --git a/cms/djangoapps/contentstore/tests/test_transcripts_utils.py b/cms/djangoapps/contentstore/tests/test_transcripts_utils.py index bba9984e76..dc0bfe373d 100644 --- a/cms/djangoapps/contentstore/tests/test_transcripts_utils.py +++ b/cms/djangoapps/contentstore/tests/test_transcripts_utils.py @@ -873,7 +873,7 @@ class TestGetTranscript(SharedModuleStoreTestCase): Verify that `get_transcript` function returns correct data when transcript is in content store. """ base_filename = 'video_101.srt' - self.upload_file(self.create_srt_file(self.subs_srt), self.video.location, base_filename) + self.upload_file(self.create_srt_file(self.subs_srt.encode('utf-8')), self.video.location, base_filename) self.create_transcript(subs_id, language, base_filename, youtube_id_1_0, html5_sources) content, file_name, mimetype = transcripts_utils.get_transcript( self.video, @@ -935,7 +935,7 @@ class TestGetTranscript(SharedModuleStoreTestCase): """ Verify that `get_transcript` function returns correct exception when transcript content is empty. """ - self.upload_file(self.create_srt_file(''), self.video.location, 'ur_video_101.srt') + self.upload_file(self.create_srt_file(b''), self.video.location, 'ur_video_101.srt') self.create_transcript('', 'ur', 'ur_video_101.srt') with self.assertRaises(NotFoundError) as no_content_exception: diff --git a/cms/djangoapps/maintenance/tests.py b/cms/djangoapps/maintenance/tests.py index 2b529792fc..9887caa733 100644 --- a/cms/djangoapps/maintenance/tests.py +++ b/cms/djangoapps/maintenance/tests.py @@ -289,7 +289,7 @@ class TestAnnouncementsViews(MaintenanceViewTestCase): """ url = reverse("maintenance:announcement_index") response = self.client.get(url) - self.assertIn('