Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
Zope
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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
Zope
Commits
8e8ecbde
Commit
8e8ecbde
authored
Dec 21, 2005
by
Stefan H. Holek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added two more tests for transaction.abort().
parent
118e4017
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
0 deletions
+18
-0
lib/python/Testing/ZopeTestCase/testZODBCompat.py
lib/python/Testing/ZopeTestCase/testZODBCompat.py
+18
-0
No files found.
lib/python/Testing/ZopeTestCase/testZODBCompat.py
View file @
8e8ecbde
...
@@ -27,6 +27,7 @@ from Testing import ZopeTestCase
...
@@ -27,6 +27,7 @@ from Testing import ZopeTestCase
import
transaction
import
transaction
from
Acquisition
import
aq_base
from
AccessControl.Permissions
import
add_documents_images_and_files
from
AccessControl.Permissions
import
add_documents_images_and_files
from
AccessControl.Permissions
import
delete_objects
from
AccessControl.Permissions
import
delete_objects
import
tempfile
import
tempfile
...
@@ -350,6 +351,23 @@ class TestTransactionAbort(ZopeTestCase.ZopeTestCase):
...
@@ -350,6 +351,23 @@ class TestTransactionAbort(ZopeTestCase.ZopeTestCase):
# This time the abort nukes the _v_foo attribute...
# This time the abort nukes the _v_foo attribute...
self
.
failIf
(
hasattr
(
self
.
folder
,
'_v_foo'
))
self
.
failIf
(
hasattr
(
self
.
folder
,
'_v_foo'
))
def
testTransactionAbortClassAttribute
(
self
):
self
.
folder
.
id
=
'bar'
self
.
failUnless
(
hasattr
(
aq_base
(
self
.
folder
),
'id'
))
transaction
.
abort
()
# The id attribute is still present
self
.
assertEqual
(
getattr
(
aq_base
(
self
.
folder
),
'id'
,
None
),
'bar'
)
def
testSubTransactionAbortClassAttribute
(
self
):
self
.
folder
.
id
=
'bar'
self
.
failUnless
(
hasattr
(
aq_base
(
self
.
folder
),
'id'
))
transaction
.
commit
(
1
)
transaction
.
abort
()
# The id attribute is still present but has been
# reset to the class default
self
.
failUnless
(
hasattr
(
aq_base
(
self
.
folder
),
'id'
))
self
.
assertEqual
(
getattr
(
aq_base
(
self
.
folder
),
'id'
,
None
),
''
)
def
test_suite
():
def
test_suite
():
from
unittest
import
TestSuite
,
makeSuite
from
unittest
import
TestSuite
,
makeSuite
...
...
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