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
77a38afa
Commit
77a38afa
authored
Aug 21, 2013
by
Chris Dodge
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add some draft courseware importing paths in common/* tests
parent
0c1c3f11
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
7 deletions
+13
-7
common/lib/xmodule/xmodule/modulestore/tests/test_mongo.py
+13
-7
No files found.
common/lib/xmodule/xmodule/modulestore/tests/test_mongo.py
View file @
77a38afa
...
...
@@ -10,6 +10,7 @@ from xblock.runtime import KeyValueStore, InvalidScopeError
from
xmodule.tests
import
DATA_DIR
from
xmodule.modulestore
import
Location
from
xmodule.modulestore.mongo
import
MongoModuleStore
,
MongoKeyValueStore
from
xmodule.modulestore.draft
import
DraftModuleStore
from
xmodule.modulestore.xml_importer
import
import_from_xml
from
xmodule.contentstore.mongo
import
MongoContentStore
...
...
@@ -36,7 +37,7 @@ class TestMongoModuleStore(object):
# is ok only as long as none of the tests modify the db.
# If (when!) that changes, need to either reload the db, or load
# once and copy over to a tmp db for each test.
cls
.
store
=
cls
.
initdb
()
cls
.
store
,
cls
.
content_store
,
cls
.
draft_store
=
cls
.
initdb
()
@classmethod
def
teardownClass
(
cls
):
...
...
@@ -50,10 +51,14 @@ class TestMongoModuleStore(object):
# since MongoModuleStore and MongoContentStore are basically assumed to be together, create this class
# as well
content_store
=
MongoContentStore
(
HOST
,
DB
)
#
# Also test draft store imports
#
draft_store
=
DraftModuleStore
(
HOST
,
DB
,
COLLECTION
,
FS_ROOT
,
RENDER_TEMPLATE
,
default_class
=
DEFAULT_CLASS
)
# Explicitly list the courses to load (don't want the big one)
courses
=
[
'toy'
,
'simple'
]
import_from_xml
(
store
,
DATA_DIR
,
courses
,
static_content_store
=
content_store
)
return
store
courses
=
[
'toy'
,
'simple'
,
'simple_with_draft'
]
import_from_xml
(
store
,
DATA_DIR
,
courses
,
draft_store
=
draft_store
,
static_content_store
=
content_store
)
return
store
,
content_store
,
draft_store
@staticmethod
def
destroy_db
(
connection
):
...
...
@@ -81,10 +86,11 @@ class TestMongoModuleStore(object):
def
test_get_courses
(
self
):
'''Make sure the course objects loaded properly'''
courses
=
self
.
store
.
get_courses
()
assert_equals
(
len
(
courses
),
2
)
assert_equals
(
len
(
courses
),
3
)
courses
.
sort
(
key
=
lambda
c
:
c
.
id
)
assert_equals
(
courses
[
0
]
.
id
,
'edX/simple/2012_Fall'
)
assert_equals
(
courses
[
1
]
.
id
,
'edX/toy/2012_Fall'
)
assert_equals
(
courses
[
1
]
.
id
,
'edX/simple_with_draft/2012_Fall'
)
assert_equals
(
courses
[
2
]
.
id
,
'edX/toy/2012_Fall'
)
def
test_loads
(
self
):
assert_not_equals
(
...
...
@@ -133,7 +139,7 @@ class TestMongoModuleStore(object):
Assumes the information is desired for courses[1] ('toy' course).
"""
return
courses
[
1
]
.
tabs
[
index
][
'name'
]
return
courses
[
2
]
.
tabs
[
index
][
'name'
]
# There was a bug where model.save was not getting called after the static tab name
# was set set for tabs that have a URL slug. 'Syllabus' and 'Resources' fall into that
...
...
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