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
30155d33
Commit
30155d33
authored
Sep 30, 2014
by
Don Mitchell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Test caching of courses in mixed maps
parent
cd1a4d1d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
1 deletions
+15
-1
common/lib/xmodule/xmodule/modulestore/tests/test_mixed_modulestore.py
+15
-1
No files found.
common/lib/xmodule/xmodule/modulestore/tests/test_mixed_modulestore.py
View file @
30155d33
...
...
@@ -30,7 +30,7 @@ from xmodule.modulestore.draft_and_published import UnsupportedRevisionError
from
xmodule.modulestore.exceptions
import
ItemNotFoundError
,
DuplicateCourseError
,
ReferentialIntegrityError
,
NoPathToItem
from
xmodule.modulestore.mixed
import
MixedModuleStore
from
xmodule.modulestore.search
import
path_to_location
from
xmodule.modulestore.tests.factories
import
check_mongo_calls
from
xmodule.modulestore.tests.factories
import
check_mongo_calls
,
check_exact_number_of_calls
from
xmodule.modulestore.tests.mongo_connection
import
MONGO_PORT_NUM
,
MONGO_HOST
from
xmodule.tests
import
DATA_DIR
...
...
@@ -272,6 +272,20 @@ class TestMixedModuleStore(unittest.TestCase):
SlashSeparatedCourseKey
(
'foo'
,
'bar'
,
'2012_Fall'
)),
mongo_ms_type
)
@ddt.data
(
'draft'
,
'split'
)
def
test_get_modulestore_cache
(
self
,
default_ms
):
"""
Make sure we cache discovered course mappings
"""
self
.
initdb
(
default_ms
)
# unset mappings
self
.
store
.
mappings
=
{}
course_key
=
self
.
course_locations
[
self
.
MONGO_COURSEID
]
.
course_key
with
check_exact_number_of_calls
(
self
.
store
.
default_modulestore
,
'has_course'
,
1
):
self
.
assertEqual
(
self
.
store
.
default_modulestore
,
self
.
store
.
_get_modulestore_for_courseid
(
course_key
))
self
.
assertIn
(
course_key
,
self
.
store
.
mappings
)
self
.
assertEqual
(
self
.
store
.
default_modulestore
,
self
.
store
.
_get_modulestore_for_courseid
(
course_key
))
@ddt.data
(
*
itertools
.
product
(
(
ModuleStoreEnum
.
Type
.
mongo
,
ModuleStoreEnum
.
Type
.
split
),
(
True
,
False
)
...
...
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