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
151782ac
Commit
151782ac
authored
Aug 21, 2013
by
Will Daly
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
LMS acceptance tests use mixed modulestore
parent
96c2a503
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
41 deletions
+17
-41
common/djangoapps/terrain/browser.py
+3
-2
common/djangoapps/terrain/course_helpers.py
+2
-4
common/lib/xmodule/xmodule/modulestore/tests/django_utils.py
+0
-29
lms/envs/acceptance.py
+12
-6
No files found.
common/djangoapps/terrain/browser.py
View file @
151782ac
...
...
@@ -108,9 +108,10 @@ def reset_databases(scenario):
mongo
=
MongoClient
()
mongo
.
drop_database
(
settings
.
CONTENTSTORE
[
'OPTIONS'
][
'db'
])
_CONTENTSTORE
.
clear
()
modulestore
=
xmodule
.
modulestore
.
django
.
modulestore
()
modulestore
=
xmodule
.
modulestore
.
django
.
editable_modulestore
()
modulestore
.
collection
.
drop
()
xmodule
.
modulestore
.
django
.
_MODULESTORES
.
clear
()
xmodule
.
modulestore
.
django
.
clear_existing_modulestores
()
# Uncomment below to trigger a screenshot on error
...
...
common/djangoapps/terrain/course_helpers.py
View file @
151782ac
...
...
@@ -10,7 +10,7 @@ from django.contrib.auth import authenticate, login
from
django.contrib.auth.middleware
import
AuthenticationMiddleware
from
django.contrib.sessions.middleware
import
SessionMiddleware
from
student.models
import
CourseEnrollment
from
xmodule.modulestore.django
import
modulestore
from
xmodule.modulestore.django
import
editable_
modulestore
from
xmodule.contentstore.django
import
contentstore
from
urllib
import
quote_plus
...
...
@@ -60,11 +60,9 @@ def register_by_course_id(course_id, is_staff=False):
@world.absorb
def
clear_courses
():
# Flush and initialize the module store
# It needs the templates because it creates new records
# by cloning from the template.
# Note that if your test module gets in some weird state
# (though it shouldn't), do this manually
# from the bash shell to drop it:
# $ mongo test_xmodule --eval "db.dropDatabase()"
modulestore
()
.
collection
.
drop
()
editable_
modulestore
()
.
collection
.
drop
()
contentstore
()
.
fs_files
.
drop
()
common/lib/xmodule/xmodule/modulestore/tests/django_utils.py
View file @
151782ac
...
...
@@ -210,32 +210,3 @@ class ModuleStoreTestCase(TestCase):
# Call superclass implementation
super
(
ModuleStoreTestCase
,
self
)
.
_post_teardown
()
def
assert2XX
(
self
,
status_code
,
msg
=
None
):
"""
Assert that the given value is a success status (between 200 and 299)
"""
msg
=
self
.
_formatMessage
(
msg
,
"
%
s is not a success status"
%
safe_repr
(
status_code
))
self
.
assertTrue
(
status_code
>=
200
and
status_code
<
300
,
msg
=
msg
)
def
assert3XX
(
self
,
status_code
,
msg
=
None
):
"""
Assert that the given value is a redirection status (between 300 and 399)
"""
msg
=
self
.
_formatMessage
(
msg
,
"
%
s is not a redirection status"
%
safe_repr
(
status_code
))
self
.
assertTrue
(
status_code
>=
300
and
status_code
<
400
,
msg
=
msg
)
def
assert4XX
(
self
,
status_code
,
msg
=
None
):
"""
Assert that the given value is a client error status (between 400 and 499)
"""
msg
=
self
.
_formatMessage
(
msg
,
"
%
s is not a client error status"
%
safe_repr
(
status_code
))
self
.
assertTrue
(
status_code
>=
400
and
status_code
<
500
,
msg
=
msg
)
def
assert5XX
(
self
,
status_code
,
msg
=
None
):
"""
Assert that the given value is a server error status (between 500 and 599)
"""
msg
=
self
.
_formatMessage
(
msg
,
"
%
s is not a server error status"
%
safe_repr
(
status_code
))
self
.
assertTrue
(
status_code
>=
500
and
status_code
<
600
,
msg
=
msg
)
lms/envs/acceptance.py
View file @
151782ac
...
...
@@ -35,15 +35,21 @@ modulestore_options = {
MODULESTORE
=
{
'default'
:
{
'ENGINE'
:
'xmodule.modulestore.mongo.MongoModuleStore'
,
'OPTIONS'
:
modulestore_options
},
'direct'
:
{
'ENGINE'
:
'xmodule.modulestore.mongo.MongoModuleStore'
,
'OPTIONS'
:
modulestore_options
'ENGINE'
:
'xmodule.modulestore.mixed.MixedModuleStore'
,
'OPTIONS'
:
{
'mappings'
:
{},
'stores'
:
{
'default'
:
{
'ENGINE'
:
'xmodule.modulestore.mongo.MongoModuleStore'
,
'OPTIONS'
:
modulestore_options
}
}
}
}
}
MODULESTORE
[
'direct'
]
=
MODULESTORE
[
'default'
]
CONTENTSTORE
=
{
'ENGINE'
:
'xmodule.contentstore.mongo.MongoContentStore'
,
'OPTIONS'
:
{
...
...
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