Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
edx-platform-release
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
1
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Hsin-Yu Chien
edx-platform-release
Commits
77a38afa
Commit
77a38afa
authored
11 years ago
by
Chris Dodge
Browse files
Options
Downloads
Patches
Plain Diff
add some draft courseware importing paths in common/* tests
parent
0c1c3f11
Loading
Loading
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
common/lib/xmodule/xmodule/modulestore/tests/test_mongo.py
+13
-7
13 additions, 7 deletions
common/lib/xmodule/xmodule/modulestore/tests/test_mongo.py
with
13 additions
and
7 deletions
common/lib/xmodule/xmodule/modulestore/tests/test_mongo.py
+
13
−
7
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
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment