BOM-399
Fixing encode/decode issues for python3.
This commit is contained in:
@@ -243,7 +243,7 @@ class TranscriptDownloadTest(CourseTestCase):
|
||||
|
||||
# Assert the actual response
|
||||
self.assertEqual(response.status_code, 200)
|
||||
self.assertEqual(response.content, expected_content)
|
||||
self.assertEqual(response.content.decode('utf-8'), expected_content)
|
||||
for attribute, value in six.iteritems(expected_headers):
|
||||
self.assertEqual(response.get(attribute), value)
|
||||
|
||||
|
||||
@@ -157,7 +157,7 @@ def transcript_download_handler(request):
|
||||
if transcript:
|
||||
name_and_extension = os.path.splitext(transcript['file_name'])
|
||||
basename, file_format = name_and_extension[0], name_and_extension[1][1:]
|
||||
transcript_filename = '{base_name}.{ext}'.format(base_name=basename.encode('utf8'), ext=Transcript.SRT)
|
||||
transcript_filename = '{base_name}.{ext}'.format(base_name=basename, ext=Transcript.SRT)
|
||||
transcript_content = Transcript.convert(
|
||||
content=transcript['content'],
|
||||
input_format=file_format,
|
||||
|
||||
Reference in New Issue
Block a user