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
e2360f39
Commit
e2360f39
authored
Sep 03, 2014
by
Calen Pennington
Committed by
Zia Fazal
Apr 06, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add specific bulk-operation test for LMS-11332, and a fix
parent
60447584
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
1 deletions
+9
-1
common/lib/xmodule/xmodule/modulestore/split_mongo/split.py
+2
-1
common/lib/xmodule/xmodule/modulestore/tests/test_split_modulestore_bulk_operations.py
+7
-0
No files found.
common/lib/xmodule/xmodule/modulestore/split_mongo/split.py
View file @
e2360f39
...
@@ -168,7 +168,8 @@ class BulkWriteRecord(object):
...
@@ -168,7 +168,8 @@ class BulkWriteRecord(object):
return
self
.
structures
.
get
(
self
.
index
.
get
(
'versions'
,
{})
.
get
(
branch
))
return
self
.
structures
.
get
(
self
.
index
.
get
(
'versions'
,
{})
.
get
(
branch
))
def
set_structure_for_branch
(
self
,
branch
,
structure
):
def
set_structure_for_branch
(
self
,
branch
,
structure
):
self
.
index
.
get
(
'versions'
,
{})[
branch
]
=
structure
[
'_id'
]
if
self
.
index
is
not
None
:
self
.
index
.
setdefault
(
'versions'
,
{})[
branch
]
=
structure
[
'_id'
]
self
.
structures
[
structure
[
'_id'
]]
=
structure
self
.
structures
[
structure
[
'_id'
]]
=
structure
def
__repr__
(
self
):
def
__repr__
(
self
):
...
...
common/lib/xmodule/xmodule/modulestore/tests/test_split_modulestore_bulk_operations.py
View file @
e2360f39
...
@@ -174,6 +174,13 @@ class TestBulkWriteMixinClosed(TestBulkWriteMixin):
...
@@ -174,6 +174,13 @@ class TestBulkWriteMixinClosed(TestBulkWriteMixin):
self
.
structure
[
'_id'
]
self
.
structure
[
'_id'
]
)
)
def
test_version_structure_new_course
(
self
):
self
.
conn
.
get_course_index
.
return_value
=
None
self
.
bulk
.
_begin_bulk_operation
(
self
.
course_key
)
version_result
=
self
.
bulk
.
version_structure
(
self
.
course_key
,
self
.
structure
,
'user_id'
)
get_result
=
self
.
bulk
.
get_structure
(
self
.
course_key
,
version_result
[
'_id'
])
self
.
assertEquals
(
version_result
,
get_result
)
class
TestBulkWriteMixinClosedAfterPrevTransaction
(
TestBulkWriteMixinClosed
,
TestBulkWriteMixinPreviousTransaction
):
class
TestBulkWriteMixinClosedAfterPrevTransaction
(
TestBulkWriteMixinClosed
,
TestBulkWriteMixinPreviousTransaction
):
"""
"""
Test that operations on with a closed transaction aren't affected by a previously executed transaction
Test that operations on with a closed transaction aren't affected by a previously executed transaction
...
...
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