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
fbd9a126
Commit
fbd9a126
authored
Jan 31, 2013
by
Don Mitchell
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1393 from MITx/fix/cdodge/export-static-tabs
add exporting of course info
parents
5f170d11
ab9d30cb
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
19 deletions
+22
-19
cms/djangoapps/contentstore/tests/tests.py
+17
-17
common/lib/xmodule/xmodule/modulestore/xml_exporter.py
+3
-0
common/test/data/full/tabs/resources.html
+2
-2
No files found.
cms/djangoapps/contentstore/tests/tests.py
View file @
fbd9a126
...
...
@@ -445,6 +445,17 @@ class ContentStoreTest(TestCase):
items
=
ms
.
get_items
(
Location
([
'i4x'
,
'edX'
,
'full'
,
'vertical'
,
None
]))
self
.
assertEqual
(
len
(
items
),
0
)
def
verify_content_existence
(
self
,
modulestore
,
root_dir
,
location
,
dirname
,
category_name
,
filename_suffix
=
''
):
fs
=
OSFS
(
root_dir
/
'test_export'
)
self
.
assertTrue
(
fs
.
exists
(
dirname
))
query_loc
=
Location
(
'i4x'
,
location
.
org
,
location
.
course
,
category_name
,
None
)
items
=
modulestore
.
get_items
(
query_loc
)
for
item
in
items
:
fs
=
OSFS
(
root_dir
/
(
'test_export/'
+
dirname
))
self
.
assertTrue
(
fs
.
exists
(
item
.
location
.
name
+
filename_suffix
))
def
test_export_course
(
self
):
ms
=
modulestore
(
'direct'
)
cs
=
contentstore
()
...
...
@@ -460,26 +471,14 @@ class ContentStoreTest(TestCase):
export_to_xml
(
ms
,
cs
,
location
,
root_dir
,
'test_export'
)
# check for static tabs
fs
=
OSFS
(
root_dir
/
'test_export'
)
self
.
assertTrue
(
fs
.
exists
(
'tabs'
))
static_tabs_query_loc
=
Location
(
'i4x'
,
location
.
org
,
location
.
course
,
'static_tab'
,
None
)
static_tabs
=
ms
.
get_items
(
static_tabs_query_loc
)
for
static_tab
in
static_tabs
:
fs
=
OSFS
(
root_dir
/
'test_export/tabs'
)
self
.
assertTrue
(
fs
.
exists
(
static_tab
.
location
.
name
+
'.html'
))
self
.
verify_content_existence
(
ms
,
root_dir
,
location
,
'tabs'
,
'static_tab'
,
'.html'
)
# check for custom_tags
fs
=
OSFS
(
root_dir
/
'test_export'
)
self
.
assertTrue
(
fs
.
exists
(
'custom_tags'
))
custom_tags_query_loc
=
Location
(
'i4x'
,
location
.
org
,
location
.
course
,
'custom_tag_template'
,
None
)
custom_tags
=
ms
.
get_items
(
custom_tags_query_loc
)
self
.
verify_content_existence
(
ms
,
root_dir
,
location
,
'info'
,
'course_info'
,
'.html'
)
for
custom_tag
in
custom_tags
:
fs
=
OSFS
(
root_dir
/
'test_export/custom_tags
'
)
self
.
assertTrue
(
fs
.
exists
(
custom_tag
.
location
.
name
))
# check for custom_tags
self
.
verify_content_existence
(
ms
,
root_dir
,
location
,
'custom_tags'
,
'custom_tag_template
'
)
# remove old course
delete_course
(
ms
,
cs
,
location
)
...
...
@@ -496,6 +495,7 @@ class ContentStoreTest(TestCase):
shutil
.
rmtree
(
root_dir
)
def
test_course_handouts_rewrites
(
self
):
ms
=
modulestore
(
'direct'
)
cs
=
contentstore
()
...
...
common/lib/xmodule/xmodule/modulestore/xml_exporter.py
View file @
fbd9a126
...
...
@@ -23,6 +23,9 @@ def export_to_xml(modulestore, contentstore, course_location, root_dir, course_d
# export the custom tags
export_extra_content
(
export_fs
,
modulestore
,
course_location
,
'custom_tag_template'
,
'custom_tags'
)
# export the course updates
export_extra_content
(
export_fs
,
modulestore
,
course_location
,
'course_info'
,
'info'
,
'.html'
)
def
export_extra_content
(
export_fs
,
modulestore
,
course_location
,
category_type
,
dirname
,
file_suffix
=
''
):
query_loc
=
Location
(
'i4x'
,
course_location
.
org
,
course_location
.
course
,
category_type
,
None
)
...
...
common/test/data/full/tabs/resources.html
View file @
fbd9a126
This is another sample tab
\ No newline at end of file
<p>
This is another sample tab
</p>
\ No newline at end of file
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