Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
edx-platform-release
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
1
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Hsin-Yu Chien
edx-platform-release
Commits
938e48e5
Commit
938e48e5
authored
11 years ago
by
Valera Rozuvan
Browse files
Options
Downloads
Plain Diff
Merge pull request #296 from edx/valera/bugfix_allow_no_youtube_attribute
Fix for bug Blades/BLD-152
parents
8207f229
97d74214
Loading
Loading
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
common/lib/xmodule/xmodule/videoalpha_module.py
+4
-1
4 additions, 1 deletion
common/lib/xmodule/xmodule/videoalpha_module.py
lms/djangoapps/courseware/tests/test_videoalpha_mongo.py
+44
-0
44 additions, 0 deletions
lms/djangoapps/courseware/tests/test_videoalpha_mongo.py
with
48 additions
and
1 deletion
common/lib/xmodule/xmodule/videoalpha_module.py
+
4
−
1
View file @
938e48e5
...
...
@@ -70,7 +70,10 @@ class VideoAlphaModule(VideoAlphaFields, XModule):
def
__init__
(
self
,
*
args
,
**
kwargs
):
XModule
.
__init__
(
self
,
*
args
,
**
kwargs
)
xmltree
=
etree
.
fromstring
(
self
.
data
)
self
.
youtube_streams
=
xmltree
.
get
(
'
youtube
'
)
# Front-end expects an empty string, or a properly formatted string with YouTube IDs.
self
.
youtube_streams
=
xmltree
.
get
(
'
youtube
'
,
''
)
self
.
sub
=
xmltree
.
get
(
'
sub
'
)
self
.
position
=
0
self
.
show_captions
=
xmltree
.
get
(
'
show_captions
'
,
'
true
'
)
...
...
This diff is collapsed.
Click to expand it.
lms/djangoapps/courseware/tests/test_videoalpha_mongo.py
+
44
−
0
View file @
938e48e5
...
...
@@ -52,3 +52,47 @@ class TestVideo(BaseTestXmodule):
'
autoplay
'
:
settings
.
MITX_FEATURES
.
get
(
'
AUTOPLAY_VIDEOS
'
,
True
)
}
self
.
assertDictEqual
(
context
,
expected_context
)
class
TestVideoNonYouTube
(
TestVideo
):
"""
Integration tests: web client + mongo.
"""
DATA
=
"""
<videoalpha show_captions=
"
true
"
data_dir=
""
caption_asset_path=
""
autoplay=
"
true
"
start_time=
"
01:00:03
"
end_time=
"
01:00:10
"
>
<source src=
"
.../mit-3091x/M-3091X-FA12-L21-3_100.mp4
"
/>
<source src=
"
.../mit-3091x/M-3091X-FA12-L21-3_100.webm
"
/>
<source src=
"
.../mit-3091x/M-3091X-FA12-L21-3_100.ogv
"
/>
</videoalpha>
"""
MODEL_DATA
=
{
'
data
'
:
DATA
}
def
test_videoalpha_constructor
(
self
):
"""
Make sure that if the
'
youtube
'
attribute is omitted in XML, then
the template generates an empty string for the YouTube streams.
"""
# `get_html` return only context, cause we
# overwrite `system.render_template`
context
=
self
.
item_module
.
get_html
()
expected_context
=
{
'
data_dir
'
:
getattr
(
self
,
'
data_dir
'
,
None
),
'
caption_asset_path
'
:
'
/c4x/MITx/999/asset/subs_
'
,
'
show_captions
'
:
self
.
item_module
.
show_captions
,
'
display_name
'
:
self
.
item_module
.
display_name_with_default
,
'
end
'
:
self
.
item_module
.
end_time
,
'
id
'
:
self
.
item_module
.
location
.
html_id
(),
'
sources
'
:
self
.
item_module
.
sources
,
'
start
'
:
self
.
item_module
.
start_time
,
'
sub
'
:
self
.
item_module
.
sub
,
'
track
'
:
self
.
item_module
.
track
,
'
youtube_streams
'
:
''
,
'
autoplay
'
:
settings
.
MITX_FEATURES
.
get
(
'
AUTOPLAY_VIDEOS
'
,
True
)
}
self
.
assertDictEqual
(
context
,
expected_context
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment