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
b3e7516a
Commit
b3e7516a
authored
Nov 10, 2014
by
Syed Hassan Raza
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Handle Unicode for Incoming Keys
parent
7b36645e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
1 deletions
+8
-1
common/lib/xmodule/xmodule/video_module/video_handlers.py
+3
-1
lms/djangoapps/courseware/tests/test_video_handlers.py
+5
-0
No files found.
common/lib/xmodule/xmodule/video_module/video_handlers.py
View file @
b3e7516a
...
...
@@ -55,7 +55,9 @@ class VideoStudentViewHandlers(object):
if
dispatch
==
'save_user_state'
:
for
key
in
data
:
if
hasattr
(
self
,
key
)
and
key
in
accepted_keys
:
if
type
(
key
)
==
str
:
key
=
unicode
(
key
,
"UTF8"
)
if
hasattr
(
self
,
key
.
encode
(
'utf8'
))
and
key
in
accepted_keys
:
if
key
in
conversions
:
value
=
conversions
[
key
](
data
[
key
])
else
:
...
...
lms/djangoapps/courseware/tests/test_video_handlers.py
View file @
b3e7516a
...
...
@@ -131,6 +131,7 @@ class TestVideo(BaseTestXmodule):
{
'speed'
:
2.0
},
{
'saved_video_position'
:
"00:00:10"
},
{
'transcript_language'
:
'uk'
},
{
'demoo�'
:
'sample'
}
]
for
sample
in
data
:
response
=
self
.
clients
[
self
.
users
[
0
]
.
username
]
.
post
(
...
...
@@ -152,6 +153,10 @@ class TestVideo(BaseTestXmodule):
self
.
item_descriptor
.
handle_ajax
(
'save_user_state'
,
{
'transcript_language'
:
"uk"
})
self
.
assertEqual
(
self
.
item_descriptor
.
transcript_language
,
'uk'
)
response
=
self
.
item_descriptor
.
handle_ajax
(
'save_user_state'
,
{
'demoo�'
:
"sample"
})
self
.
assertEqual
(
json
.
loads
(
response
)[
'success'
],
True
)
def
tearDown
(
self
):
_clear_assets
(
self
.
item_descriptor
.
location
)
...
...
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