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
fedc0680
Commit
fedc0680
authored
Mar 12, 2014
by
Don Mitchell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Test schema is set in each collection
parent
0895e90a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
0 deletions
+21
-0
common/lib/xmodule/xmodule/modulestore/tests/test_split_modulestore.py
+21
-0
No files found.
common/lib/xmodule/xmodule/modulestore/tests/test_split_modulestore.py
View file @
fedc0680
...
...
@@ -18,6 +18,7 @@ from xmodule.modulestore.inheritance import InheritanceMixin
from
xmodule.x_module
import
XModuleMixin
from
xmodule.fields
import
Date
,
Timedelta
from
bson.objectid
import
ObjectId
from
xmodule.modulestore.split_mongo.split
import
SplitMongoModuleStore
class
SplitModuleTest
(
unittest
.
TestCase
):
...
...
@@ -1625,6 +1626,26 @@ class TestPublish(SplitModuleTest):
dest_cursor
+=
1
self
.
assertEqual
(
dest_cursor
,
len
(
dest_children
))
class
TestSchema
(
SplitModuleTest
):
"""
Test the db schema (and possibly eventually migrations?)
"""
def
test_schema
(
self
):
"""
Test that the schema is set in each document
"""
db_connection
=
modulestore
()
.
db_connection
for
collection
in
[
db_connection
.
course_index
,
db_connection
.
structures
,
db_connection
.
definitions
]:
self
.
assertEqual
(
collection
.
find
({
'schema_version'
:
{
'$exists'
:
False
}})
.
count
(),
0
,
"{0.name} has records without schema_version"
.
format
(
collection
)
)
self
.
assertEqual
(
collection
.
find
({
'schema_version'
:
{
'$ne'
:
SplitMongoModuleStore
.
SCHEMA_VERSION
}})
.
count
(),
0
,
"{0.name} has records with wrong schema_version"
.
format
(
collection
)
)
#===========================================
def
modulestore
():
...
...
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