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
fc57e7af
Commit
fc57e7af
authored
Jan 31, 2013
by
Chris Dodge
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add testing for course info export. Plus DRY things out a bit
parent
0d20c192
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
18 deletions
+18
-18
cms/djangoapps/contentstore/tests/tests.py
+16
-16
common/test/data/full/tabs/resources.html
+2
-2
No files found.
cms/djangoapps/contentstore/tests/tests.py
View file @
fc57e7af
...
@@ -418,6 +418,17 @@ class ContentStoreTest(TestCase):
...
@@ -418,6 +418,17 @@ class ContentStoreTest(TestCase):
items
=
ms
.
get_items
(
Location
([
'i4x'
,
'edX'
,
'full'
,
'vertical'
,
None
]))
items
=
ms
.
get_items
(
Location
([
'i4x'
,
'edX'
,
'full'
,
'vertical'
,
None
]))
self
.
assertEqual
(
len
(
items
),
0
)
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
):
def
test_export_course
(
self
):
ms
=
modulestore
(
'direct'
)
ms
=
modulestore
(
'direct'
)
cs
=
contentstore
()
cs
=
contentstore
()
...
@@ -433,26 +444,14 @@ class ContentStoreTest(TestCase):
...
@@ -433,26 +444,14 @@ class ContentStoreTest(TestCase):
export_to_xml
(
ms
,
cs
,
location
,
root_dir
,
'test_export'
)
export_to_xml
(
ms
,
cs
,
location
,
root_dir
,
'test_export'
)
# check for static tabs
# check for static tabs
fs
=
OSFS
(
root_dir
/
'test_export'
)
self
.
verify_content_existence
(
ms
,
root_dir
,
location
,
'tabs'
,
'static_tab'
,
'.html'
)
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'
))
# check for custom_tags
# check for custom_tags
fs
=
OSFS
(
root_dir
/
'test_export'
)
self
.
verify_content_existence
(
ms
,
root_dir
,
location
,
'info'
,
'course_info'
,
'.html'
)
self
.
assertTrue
(
fs
.
exists
(
'custom_tags'
))
custom_tags_query_loc
=
Location
(
'i4x'
,
location
.
org
,
location
.
course
,
'custom_tag_template'
,
None
)
# check for custom_tags
custom_tags
=
ms
.
get_items
(
custom_tags_query_loc
)
self
.
verify_content_existence
(
ms
,
root_dir
,
location
,
'custom_tags'
,
'custom_tag_template'
)
for
custom_tag
in
custom_tags
:
fs
=
OSFS
(
root_dir
/
'test_export/custom_tags'
)
self
.
assertTrue
(
fs
.
exists
(
custom_tag
.
location
.
name
))
# remove old course
# remove old course
delete_course
(
ms
,
cs
,
location
)
delete_course
(
ms
,
cs
,
location
)
...
@@ -469,6 +468,7 @@ class ContentStoreTest(TestCase):
...
@@ -469,6 +468,7 @@ class ContentStoreTest(TestCase):
shutil
.
rmtree
(
root_dir
)
shutil
.
rmtree
(
root_dir
)
def
test_course_handouts_rewrites
(
self
):
def
test_course_handouts_rewrites
(
self
):
ms
=
modulestore
(
'direct'
)
ms
=
modulestore
(
'direct'
)
cs
=
contentstore
()
cs
=
contentstore
()
...
...
common/test/data/full/tabs/resources.html
View file @
fc57e7af
This is another sample tab
<p>
This is another sample tab
</p>
\ No newline at end of file
\ 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