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
687708c3
Commit
687708c3
authored
Sep 17, 2014
by
Calen Pennington
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use InheritanceMixin in more modulestore tests
parent
234c1805
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
2 deletions
+16
-2
common/lib/xmodule/xmodule/modulestore/tests/test_cross_modulestore_import_export.py
+14
-1
common/lib/xmodule/xmodule/modulestore/tests/test_mixed_modulestore.py
+2
-1
No files found.
common/lib/xmodule/xmodule/modulestore/tests/test_cross_modulestore_import_export.py
View file @
687708c3
...
...
@@ -28,6 +28,8 @@ from xmodule.modulestore.xml_importer import import_from_xml
from
xmodule.modulestore.xml_exporter
import
export_to_xml
from
xmodule.modulestore.split_mongo.split_draft
import
DraftVersioningModuleStore
from
xmodule.modulestore.tests.mongo_connection
import
MONGO_PORT_NUM
,
MONGO_HOST
from
xmodule.modulestore.inheritance
import
InheritanceMixin
from
xmodule.x_module
import
XModuleMixin
COMMON_DOCSTORE_CONFIG
=
{
...
...
@@ -36,6 +38,9 @@ COMMON_DOCSTORE_CONFIG = {
}
XBLOCK_MIXINS
=
(
InheritanceMixin
,
XModuleMixin
)
class
MemoryCache
(
object
):
"""
This fits the metadata_inheritance_cache_subsystem interface used by
...
...
@@ -95,6 +100,7 @@ class MongoModulestoreBuilder(object):
render_template
=
repr
,
branch_setting_func
=
lambda
:
ModuleStoreEnum
.
Branch
.
draft_preferred
,
metadata_inheritance_cache_subsystem
=
MemoryCache
(),
xblock_mixins
=
XBLOCK_MIXINS
,
)
modulestore
.
ensure_indexes
()
...
...
@@ -139,6 +145,7 @@ class VersioningModulestoreBuilder(object):
doc_store_config
,
fs_root
,
render_template
=
repr
,
xblock_mixins
=
XBLOCK_MIXINS
,
)
modulestore
.
ensure_indexes
()
...
...
@@ -189,7 +196,13 @@ class MixedModulestoreBuilder(object):
# Generate a fake list of stores to give the already generated stores appropriate names
stores
=
[{
'NAME'
:
name
,
'ENGINE'
:
'This space deliberately left blank'
}
for
name
in
names
]
modulestore
=
MixedModuleStore
(
contentstore
,
self
.
mappings
,
stores
,
create_modulestore_instance
=
create_modulestore_instance
)
modulestore
=
MixedModuleStore
(
contentstore
,
self
.
mappings
,
stores
,
create_modulestore_instance
=
create_modulestore_instance
,
xblock_mixins
=
XBLOCK_MIXINS
,
)
yield
modulestore
...
...
common/lib/xmodule/xmodule/modulestore/tests/test_mixed_modulestore.py
View file @
687708c3
...
...
@@ -18,6 +18,7 @@ from uuid import uuid4
# TODO remove this import and the configuration -- xmodule should not depend on django!
from
django.conf
import
settings
from
xmodule.modulestore.edit_info
import
EditInfoMixin
from
xmodule.modulestore.inheritance
import
InheritanceMixin
if
not
settings
.
configured
:
settings
.
configure
()
...
...
@@ -58,7 +59,7 @@ class TestMixedModuleStore(unittest.TestCase):
'default_class'
:
DEFAULT_CLASS
,
'fs_root'
:
DATA_DIR
,
'render_template'
:
RENDER_TEMPLATE
,
'xblock_mixins'
:
(
EditInfoMixin
,
)
'xblock_mixins'
:
(
EditInfoMixin
,
InheritanceMixin
),
}
DOC_STORE_CONFIG
=
{
'host'
:
HOST
,
...
...
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