Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
5d34bb0d
Commit
5d34bb0d
authored
Mar 02, 2015
by
Shrhawk
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #6859 from edx/shr/bug/TNL-1253-mobile-api-transcript-filname-unicode
Unicode handling for transcript filename
parents
e8a1e810
7b194a33
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
3 deletions
+9
-3
lms/djangoapps/mobile_api/video_outlines/tests.py
+8
-2
lms/djangoapps/mobile_api/video_outlines/views.py
+1
-1
No files found.
lms/djangoapps/mobile_api/video_outlines/tests.py
View file @
5d34bb0d
# -*- coding: utf-8 -*-
"""
Tests for video outline API
"""
...
...
@@ -100,11 +101,11 @@ class TestVideoAPITestCase(MobileAPITestCase):
}
]})
def
_create_video_with_subs
(
self
):
def
_create_video_with_subs
(
self
,
custom_subid
=
None
):
"""
Creates and returns a video with stored subtitles.
"""
subid
=
uuid4
()
.
hex
subid
=
custom_subid
or
uuid4
()
.
hex
transcripts_utils
.
save_subs_to_store
(
{
'start'
:
[
100
,
200
,
240
,
390
,
1000
],
...
...
@@ -578,3 +579,8 @@ class TestTranscriptsDetail(TestVideoAPITestCase, MobileAuthTestMixin, MobileEnr
def
test_incorrect_language
(
self
):
self
.
login_and_enroll
()
self
.
api_response
(
expected_response_code
=
404
,
lang
=
'pl'
)
def
test_transcript_with_unicode_file_name
(
self
):
self
.
video
=
self
.
_create_video_with_subs
(
custom_subid
=
u'你好'
)
self
.
login_and_enroll
()
self
.
api_response
(
expected_response_code
=
200
,
lang
=
'en'
)
lms/djangoapps/mobile_api/video_outlines/views.py
View file @
5d34bb0d
...
...
@@ -121,6 +121,6 @@ class VideoTranscripts(generics.RetrieveAPIView):
raise
Http404
(
u"Transcript not found for {}, lang: {}"
.
format
(
block_id
,
lang
))
response
=
HttpResponse
(
content
,
content_type
=
mimetype
)
response
[
'Content-Disposition'
]
=
'attachment; filename="{}"'
.
format
(
filename
)
response
[
'Content-Disposition'
]
=
'attachment; filename="{}"'
.
format
(
filename
.
encode
(
'utf-8'
)
)
return
response
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment