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
c1dec40c
Commit
c1dec40c
authored
Mar 31, 2016
by
Qubad786
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
check transcripts bfore using it
parent
9543989e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
6 deletions
+16
-6
common/lib/xmodule/xmodule/tests/test_video.py
+9
-0
common/lib/xmodule/xmodule/video_module/video_module.py
+7
-6
No files found.
common/lib/xmodule/xmodule/tests/test_video.py
View file @
c1dec40c
...
@@ -741,6 +741,15 @@ class VideoExportTestCase(VideoDescriptorTestBase):
...
@@ -741,6 +741,15 @@ class VideoExportTestCase(VideoDescriptorTestBase):
expected
=
'<video url_name="SampleProblem" download_video="false"/>
\n
'
expected
=
'<video url_name="SampleProblem" download_video="false"/>
\n
'
self
.
assertEquals
(
expected
,
etree
.
tostring
(
xml
,
pretty_print
=
True
))
self
.
assertEquals
(
expected
,
etree
.
tostring
(
xml
,
pretty_print
=
True
))
def
test_export_to_xml_with_transcripts_as_none
(
self
):
"""
Test XML export with transcripts being overridden to None.
"""
self
.
descriptor
.
transcripts
=
None
xml
=
self
.
descriptor
.
definition_to_xml
(
None
)
expected
=
'<video url_name="SampleProblem" download_video="false"/>
\n
'
self
.
assertEquals
(
expected
,
etree
.
tostring
(
xml
,
pretty_print
=
True
))
class
VideoDescriptorIndexingTestCase
(
unittest
.
TestCase
):
class
VideoDescriptorIndexingTestCase
(
unittest
.
TestCase
):
"""
"""
...
...
common/lib/xmodule/xmodule/video_module/video_module.py
View file @
c1dec40c
...
@@ -573,12 +573,13 @@ class VideoDescriptor(VideoFields, VideoTranscriptsMixin, VideoStudioViewHandler
...
@@ -573,12 +573,13 @@ class VideoDescriptor(VideoFields, VideoTranscriptsMixin, VideoStudioViewHandler
ele
.
set
(
'src'
,
self
.
handout
)
ele
.
set
(
'src'
,
self
.
handout
)
xml
.
append
(
ele
)
xml
.
append
(
ele
)
# sorting for easy testing of resulting xml
if
self
.
transcripts
is
not
None
:
for
transcript_language
in
sorted
(
self
.
transcripts
.
keys
()):
# sorting for easy testing of resulting xml
ele
=
etree
.
Element
(
'transcript'
)
for
transcript_language
in
sorted
(
self
.
transcripts
.
keys
()):
ele
.
set
(
'language'
,
transcript_language
)
ele
=
etree
.
Element
(
'transcript'
)
ele
.
set
(
'src'
,
self
.
transcripts
[
transcript_language
])
ele
.
set
(
'language'
,
transcript_language
)
xml
.
append
(
ele
)
ele
.
set
(
'src'
,
self
.
transcripts
[
transcript_language
])
xml
.
append
(
ele
)
if
self
.
edx_video_id
and
edxval_api
:
if
self
.
edx_video_id
and
edxval_api
:
try
:
try
:
...
...
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