diff --git a/lms/djangoapps/courseware/tests/test_video_mongo.py b/lms/djangoapps/courseware/tests/test_video_mongo.py index 34bb6f6d0a..2b089023e5 100644 --- a/lms/djangoapps/courseware/tests/test_video_mongo.py +++ b/lms/djangoapps/courseware/tests/test_video_mongo.py @@ -5,6 +5,7 @@ Video xmodule tests in mongo. from __future__ import absolute_import +import io import json import shutil from collections import OrderedDict @@ -1687,9 +1688,10 @@ class VideoBlockTest(TestCase, VideoBlockTestBase): self.assertEqual([transcript_file_name], self.file_system.listdir(EXPORT_IMPORT_STATIC_DIR)) # Also verify the content of created transcript file. - expected_transcript_content = File(open(expected_transcript_path)).read() + expected_transcript_content = File(io.open(expected_transcript_path)).read() transcript = get_video_transcript_data(video_id=self.descriptor.edx_video_id, language_code=language_code) - self.assertEqual(transcript['content'], expected_transcript_content) + + self.assertEqual(transcript['content'].decode('utf-8'), expected_transcript_content) @ddt.data( (['en', 'da'], 'test_sub', ''), @@ -1747,9 +1749,10 @@ class VideoBlockTest(TestCase, VideoBlockTestBase): combine(self.temp_dir, EXPORT_IMPORT_COURSE_DIR), combine(EXPORT_IMPORT_STATIC_DIR, expected_transcripts[language]) ) - expected_transcript_content = File(open(expected_transcript_path)).read() + expected_transcript_content = File(io.open(expected_transcript_path)).read() transcript = get_video_transcript_data(video_id=self.descriptor.edx_video_id, language_code=language) - self.assertEqual(transcript['content'], expected_transcript_content) + + self.assertEqual(transcript['content'].decode('utf-8'), expected_transcript_content) def test_export_val_data_not_found(self): """