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
54ee1607
Commit
54ee1607
authored
Jan 23, 2013
by
Chris Dodge
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add unit test to test DraftModuleStore.get_items() fix
parent
966db4fb
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
0 deletions
+24
-0
lms/djangoapps/courseware/tests/tests.py
+24
-0
No files found.
lms/djangoapps/courseware/tests/tests.py
View file @
54ee1607
...
@@ -64,6 +64,21 @@ def mongo_store_config(data_dir):
...
@@ -64,6 +64,21 @@ def mongo_store_config(data_dir):
}
}
}
}
def
draft_mongo_store_config
(
data_dir
):
return
{
'default'
:
{
'ENGINE'
:
'xmodule.modulestore.mongo.DraftMongoModuleStore'
,
'OPTIONS'
:
{
'default_class'
:
'xmodule.raw_module.RawDescriptor'
,
'host'
:
'localhost'
,
'db'
:
'test_xmodule'
,
'collection'
:
'modulestore'
,
'fs_root'
:
data_dir
,
'render_template'
:
'mitxmako.shortcuts.render_to_string'
,
}
}
}
def
xml_store_config
(
data_dir
):
def
xml_store_config
(
data_dir
):
return
{
return
{
'default'
:
{
'default'
:
{
...
@@ -78,6 +93,7 @@ def xml_store_config(data_dir):
...
@@ -78,6 +93,7 @@ def xml_store_config(data_dir):
TEST_DATA_DIR
=
settings
.
COMMON_TEST_DATA_ROOT
TEST_DATA_DIR
=
settings
.
COMMON_TEST_DATA_ROOT
TEST_DATA_XML_MODULESTORE
=
xml_store_config
(
TEST_DATA_DIR
)
TEST_DATA_XML_MODULESTORE
=
xml_store_config
(
TEST_DATA_DIR
)
TEST_DATA_MONGO_MODULESTORE
=
mongo_store_config
(
TEST_DATA_DIR
)
TEST_DATA_MONGO_MODULESTORE
=
mongo_store_config
(
TEST_DATA_DIR
)
TEST_DATA_DRAFT_MONGO_MODULESTORE
=
draft_mongo_store_config
(
TEST_DATA_DIR
)
class
ActivateLoginTestCase
(
TestCase
):
class
ActivateLoginTestCase
(
TestCase
):
'''Check that we can activate and log in'''
'''Check that we can activate and log in'''
...
@@ -423,6 +439,14 @@ class TestNavigation(PageLoader):
...
@@ -423,6 +439,14 @@ class TestNavigation(PageLoader):
kwargs
=
{
'course_id'
:
self
.
toy
.
id
,
'chapter'
:
'secret:magic'
}))
kwargs
=
{
'course_id'
:
self
.
toy
.
id
,
'chapter'
:
'secret:magic'
}))
@override_settings
(
MODULESTORE
=
TEST_DATA_DRAFT_MONGO_MODULESTORE
)
class
TestDraftModuleStore
(
TestCase
):
def
test_get_items_with_course_items
(
self
):
store
=
modulestore
()
# fix was to allow get_items() to take the course_id parameter
store
.
get_items
(
Location
(
None
,
None
,
'vertical'
,
None
,
None
),
course_id
=
'abc'
,
depth
=
0
)
@override_settings
(
MODULESTORE
=
TEST_DATA_XML_MODULESTORE
)
@override_settings
(
MODULESTORE
=
TEST_DATA_XML_MODULESTORE
)
class
TestViewAuth
(
PageLoader
):
class
TestViewAuth
(
PageLoader
):
"""Check that view authentication works properly"""
"""Check that view authentication works properly"""
...
...
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