Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
ZODB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
ZODB
Commits
3aa42526
Commit
3aa42526
authored
Mar 03, 2014
by
Godefroid Chapelle
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add test for fix POSKeyError during commit after savepoint rollback
see
https://github.com/zopefoundation/ZODB/issues/16
parent
9e84a83a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
0 deletions
+24
-0
src/ZODB/tests/testZODB.py
src/ZODB/tests/testZODB.py
+24
-0
No files found.
src/ZODB/tests/testZODB.py
View file @
3aa42526
...
...
@@ -17,6 +17,7 @@ from ZODB.POSException import ReadConflictError
from
ZODB.POSException
import
TransactionFailedError
import
doctest
from
BTrees.OOBTree
import
OOBTree
import
transaction
import
unittest
import
ZODB
...
...
@@ -27,6 +28,7 @@ import ZODB.tests.util
class
P
(
Persistent
):
pass
class
ZODBTests
(
ZODB
.
tests
.
util
.
TestCase
):
def
setUp
(
self
):
...
...
@@ -327,6 +329,28 @@ class ZODBTests(ZODB.tests.util.TestCase):
cn
.
close
()
def
checkSavepointRollbackAndReadCurrent
(
self
):
'''
savepoint rollback after readcurrent was called on a new object
should not raise POSKeyError
'''
cn
=
self
.
_db
.
open
()
try
:
transaction
.
begin
()
root
=
cn
.
root
()
added_before_savepoint
=
P
()
root
[
'added_before_savepoint'
]
=
added_before_savepoint
sp
=
transaction
.
savepoint
()
added_before_savepoint
.
btree
=
new_btree
=
OOBTree
()
cn
.
add
(
new_btree
)
new_btree
[
'change_to_trigger_read_current'
]
=
P
()
sp
.
rollback
()
transaction
.
commit
()
self
.
assertTrue
(
'added_before_savepoint'
in
root
)
finally
:
transaction
.
abort
()
cn
.
close
()
def
checkFailingSavepointSticks
(
self
):
cn
=
self
.
_db
.
open
()
rt
=
cn
.
root
()
...
...
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