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
40e7cab8
Commit
40e7cab8
authored
May 14, 2014
by
Calen Pennington
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix failing mongo modulestore unit tests
parent
ecdb9ec4
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
7 deletions
+7
-7
common/lib/xmodule/xmodule/modulestore/tests/test_mongo.py
+7
-7
No files found.
common/lib/xmodule/xmodule/modulestore/tests/test_mongo.py
View file @
40e7cab8
...
...
@@ -401,15 +401,15 @@ class TestMongoModuleStore(unittest.TestCase):
Test to make sure that we have a course image in the contentstore,
then export it to ensure it gets copied to both file locations.
"""
location
=
Location
(
'c4x'
,
'edX'
,
'simple'
,
'asset'
,
'images_course_image.jpg
'
)
course_location
=
Location
(
'i4x'
,
'edX'
,
'simple'
,
'course'
,
'2012_Fall
'
)
course_key
=
SlashSeparatedCourseKey
(
'edX'
,
'simple'
,
'2012_Fall
'
)
location
=
course_key
.
make_asset_key
(
'asset'
,
'images_course_image.jpg
'
)
# This will raise if the course image is missing
self
.
content_store
.
find
(
location
)
root_dir
=
path
(
mkdtemp
())
try
:
export_to_xml
(
self
.
store
,
self
.
content_store
,
course_
location
,
root_dir
,
'test_export'
)
export_to_xml
(
self
.
store
,
self
.
content_store
,
course_
key
,
root_dir
,
'test_export'
)
assert_true
(
path
(
root_dir
/
'test_export/static/images/course_image.jpg'
)
.
isfile
())
assert_true
(
path
(
root_dir
/
'test_export/static/images_course_image.jpg'
)
.
isfile
())
finally
:
...
...
@@ -420,12 +420,12 @@ class TestMongoModuleStore(unittest.TestCase):
Make sure that if a non-default image path is specified that we
don't export it to the static default location
"""
course
=
self
.
get_course_by_id
(
'edX/toy/2012_Fall'
)
course
=
self
.
store
.
get_course
(
SlashSeparatedCourseKey
(
'edX'
,
'toy'
,
'2012_Fall'
)
)
assert_true
(
course
.
course_image
,
'just_a_test.jpg'
)
root_dir
=
path
(
mkdtemp
())
try
:
export_to_xml
(
self
.
store
,
self
.
content_store
,
course
.
location
,
root_dir
,
'test_export'
)
export_to_xml
(
self
.
store
,
self
.
content_store
,
course
.
id
,
root_dir
,
'test_export'
)
assert_true
(
path
(
root_dir
/
'test_export/static/just_a_test.jpg'
)
.
isfile
())
assert_false
(
path
(
root_dir
/
'test_export/static/images/course_image.jpg'
)
.
isfile
())
finally
:
...
...
@@ -436,10 +436,10 @@ class TestMongoModuleStore(unittest.TestCase):
Make sure we elegantly passover our code when there isn't a static
image
"""
course
=
self
.
get_course_by_id
(
'edX/simple_with_draft/2012_Fall'
)
course
=
self
.
store
.
get_course
(
SlashSeparatedCourseKey
(
'edX'
,
'simple_with_draft'
,
'2012_Fall'
)
)
root_dir
=
path
(
mkdtemp
())
try
:
export_to_xml
(
self
.
store
,
self
.
content_store
,
course
.
location
,
root_dir
,
'test_export'
)
export_to_xml
(
self
.
store
,
self
.
content_store
,
course
.
id
,
root_dir
,
'test_export'
)
assert_false
(
path
(
root_dir
/
'test_export/static/images/course_image.jpg'
)
.
isfile
())
assert_false
(
path
(
root_dir
/
'test_export/static/images_course_image.jpg'
)
.
isfile
())
finally
:
...
...
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