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
96a9d741
Commit
96a9d741
authored
Jul 17, 2013
by
Calen Pennington
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #422 from edx/release
Hotfix: 2013-07-17
parents
726a85c7
ab482277
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
39 additions
and
0 deletions
+39
-0
cms/djangoapps/contentstore/tests/test_contentstore.py
+31
-0
common/lib/xmodule/xmodule/video_module.py
+7
-0
common/test/data/toy/vertical/vertical_test.xml
+1
-0
No files found.
cms/djangoapps/contentstore/tests/test_contentstore.py
View file @
96a9d741
...
...
@@ -801,6 +801,37 @@ class ContentStoreToyCourseTest(ModuleStoreTestCase):
shutil
.
rmtree
(
root_dir
)
def
test_export_course_with_metadata_only_video
(
self
):
module_store
=
modulestore
(
'direct'
)
draft_store
=
modulestore
(
'draft'
)
content_store
=
contentstore
()
import_from_xml
(
module_store
,
'common/test/data/'
,
[
'toy'
])
location
=
CourseDescriptor
.
id_to_location
(
'edX/toy/2012_Fall'
)
# create a new video module and add it as a child to a vertical
# this re-creates a bug whereby since the video template doesn't have
# anything in 'data' field, the export was blowing up
verticals
=
module_store
.
get_items
([
'i4x'
,
'edX'
,
'toy'
,
'vertical'
,
None
,
None
])
self
.
assertGreater
(
len
(
verticals
),
0
)
new_component_location
=
Location
(
'i4x'
,
'edX'
,
'toy'
,
'video'
,
'new_component'
)
source_template_location
=
Location
(
'i4x'
,
'edx'
,
'templates'
,
'video'
,
'default'
)
module_store
.
clone_item
(
source_template_location
,
new_component_location
)
parent
=
verticals
[
0
]
module_store
.
update_children
(
parent
.
location
,
parent
.
children
+
[
new_component_location
.
url
()])
root_dir
=
path
(
mkdtemp_clean
())
print
'Exporting to tempdir = {0}'
.
format
(
root_dir
)
# export out to a tempdir
export_to_xml
(
module_store
,
content_store
,
location
,
root_dir
,
'test_export'
,
draft_modulestore
=
draft_store
)
shutil
.
rmtree
(
root_dir
)
def
test_course_handouts_rewrites
(
self
):
module_store
=
modulestore
(
'direct'
)
...
...
common/lib/xmodule/xmodule/video_module.py
View file @
96a9d741
...
...
@@ -128,6 +128,13 @@ class VideoDescriptor(VideoFields,
_parse_video_xml
(
video
,
xml_data
)
return
video
def
definition_to_xml
(
self
,
resource_fs
):
"""
Override the base implementation. We don't actually have anything in the 'data' field
(it's an empty string), so we just return a simple XML element
"""
return
etree
.
fromstring
(
'<video />'
)
def
_parse_video_xml
(
video
,
xml_data
):
"""
...
...
common/test/data/toy/vertical/vertical_test.xml
View file @
96a9d741
<sequential>
<video
display_name=
"default"
youtube_id_0_75=
"JMD_ifUUfsU"
youtube_id_1_0=
"OEoXaMPEzfM"
youtube_id_1_25=
"AKqURZnYqpk"
youtube_id_1_5=
"DYpADpL7jAY"
name=
"sample_video"
/>
<poll_question
name=
"T1_changemind_poll_foo_2"
display_name=
"Change your answer"
reset=
"false"
>
<p>
Have you changed your mind?
</p>
<answer
id=
"yes"
>
Yes
</answer>
...
...
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