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
53f7c507
Commit
53f7c507
authored
Jan 31, 2014
by
Don Mitchell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added test for defaulting use_locations
parent
c601b756
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
1 deletions
+25
-1
common/lib/xmodule/xmodule/modulestore/mixed.py
+1
-1
common/lib/xmodule/xmodule/modulestore/tests/test_mixed_modulestore.py
+24
-0
No files found.
common/lib/xmodule/xmodule/modulestore/mixed.py
View file @
53f7c507
...
...
@@ -36,7 +36,7 @@ class MixedModuleStore(ModuleStoreWriteBase):
self
.
mappings
=
mappings
# temporary code for transition period
if
reference_type
is
None
:
log
.
warn
(
"reference_type not specified in MixedModuleStore settings."
,
log
.
warn
(
"reference_type not specified in MixedModuleStore settings.
%
s
"
,
"Will default temporarily to the to-be-deprecated Location."
)
self
.
use_locations
=
(
reference_type
!=
'Locator'
)
if
'default'
not
in
stores
:
...
...
common/lib/xmodule/xmodule/modulestore/tests/test_mixed_modulestore.py
View file @
53f7c507
...
...
@@ -13,6 +13,8 @@ from xmodule.modulestore.xml_importer import import_from_xml
# Mixed modulestore depends on django, so we'll manually configure some django settings
# before importing the module
from
django.conf
import
settings
import
unittest
import
copy
if
not
settings
.
configured
:
settings
.
configure
()
...
...
@@ -245,3 +247,25 @@ class TestMixedModuleStore(object):
assert_equals
(
Location
(
parents
[
0
])
.
org
,
'edX'
)
assert_equals
(
Location
(
parents
[
0
])
.
course
,
'toy'
)
assert_equals
(
Location
(
parents
[
0
])
.
name
,
'2012_Fall'
)
class
TestMixedMSInit
(
unittest
.
TestCase
):
"""
Test initializing w/o a reference_type
"""
def
setUp
(
self
):
unittest
.
TestCase
.
setUp
(
self
)
options
=
copy
.
copy
(
OPTIONS
)
del
options
[
'reference_type'
]
self
.
connection
=
pymongo
.
MongoClient
(
host
=
HOST
,
port
=
PORT
,
tz_aware
=
True
,
)
self
.
store
=
MixedModuleStore
(
**
options
)
def
test_use_locations
(
self
):
"""
Test that use_locations defaulted correctly
"""
self
.
assertTrue
(
self
.
store
.
use_locations
)
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