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
8e7fc153
Commit
8e7fc153
authored
Sep 23, 2013
by
Don Mitchell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Test asset import/export roundtrip w/ lock setting.
parent
d1a82f2a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
0 deletions
+19
-0
cms/djangoapps/contentstore/tests/test_contentstore.py
+19
-0
No files found.
cms/djangoapps/contentstore/tests/test_contentstore.py
View file @
8e7fc153
...
...
@@ -170,6 +170,16 @@ class ContentStoreToyCourseTest(ModuleStoreTestCase):
resp
=
self
.
client
.
get
(
reverse
(
'edit_unit'
,
kwargs
=
{
'location'
:
descriptor
.
location
.
url
()}))
self
.
assertEqual
(
resp
.
status_code
,
200
)
def
lockAnAsset
(
self
,
content_store
,
course_location
):
"""
Lock an arbitrary asset in the course
:param course_location:
"""
course_assets
=
content_store
.
get_all_content_for_course
(
course_location
)
self
.
assertGreater
(
len
(
course_assets
),
0
,
"No assets to lock"
)
content_store
.
set_attr
(
course_assets
[
0
][
'_id'
],
'locked'
,
True
)
return
course_assets
[
0
][
'_id'
]
def
test_edit_unit_toy
(
self
):
self
.
check_edit_unit
(
'toy'
)
...
...
@@ -952,6 +962,11 @@ class ContentStoreToyCourseTest(ModuleStoreTestCase):
self
.
assertIn
(
private_location_no_draft
.
url
(),
sequential
.
children
)
locked_asset
=
self
.
lockAnAsset
(
content_store
,
location
)
locked_asset_attrs
=
content_store
.
get_attrs
(
locked_asset
)
# the later import will reupload
del
locked_asset_attrs
[
'uploadDate'
]
print
'Exporting to tempdir = {0}'
.
format
(
root_dir
)
# export out to a tempdir
...
...
@@ -1034,6 +1049,10 @@ class ContentStoreToyCourseTest(ModuleStoreTestCase):
self
.
assertGreater
(
len
(
course
.
textbooks
),
0
)
new_attrs
=
content_store
.
get_attrs
(
locked_asset
)
for
key
,
value
in
locked_asset_attrs
.
iteritems
():
self
.
assertEqual
(
value
,
new_attrs
[
key
])
shutil
.
rmtree
(
root_dir
)
def
test_export_course_with_metadata_only_video
(
self
):
...
...
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