Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Douglas
erp5
Commits
05364754
Commit
05364754
authored
Jun 29, 2011
by
Yusei Tahara
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add a test for the bug #20110628-ABAA76.
parent
ffd66c63
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
48 additions
and
0 deletions
+48
-0
product/ERP5Type/tests/testDynamicClassGeneration.py
product/ERP5Type/tests/testDynamicClassGeneration.py
+48
-0
No files found.
product/ERP5Type/tests/testDynamicClassGeneration.py
View file @
05364754
...
@@ -1076,6 +1076,54 @@ class TestZodbPropertySheet(ERP5TypeTestCase):
...
@@ -1076,6 +1076,54 @@ class TestZodbPropertySheet(ERP5TypeTestCase):
self
.
test_module
.
setTitle
,
self
.
test_module
.
setTitle
,
'my_property_type_validity_constraint_title'
)
'my_property_type_validity_constraint_title'
)
def
testConstraintAfterClosingZODBConnection
(
self
):
"""
Make sure that constraint works even if ZODB connection close.
This test is added for the bug #20110628-ABAA76.
"""
# Open new connection and add a new constraint.
db
=
self
.
app
.
_p_jar
.
db
()
con
=
db
.
open
()
app
=
con
.
root
()[
'Application'
].
__of__
(
self
.
app
.
aq_parent
)
portal
=
app
[
self
.
getPortalName
()]
from
Products.ERP5.ERP5Site
import
getSite
,
setSite
old_site
=
getSite
()
setSite
(
portal
)
import
erp5
dummy
=
getattr
(
erp5
.
portal_type
,
'TALES Constraint'
)(
id
=
'dummy'
)
portal
.
portal_property_sheets
.
TestMigration
.
_setObject
(
'dummy'
,
dummy
)
dummy
=
portal
.
portal_property_sheets
.
TestMigration
.
dummy
dummy
.
edit
(
reference
=
'test_dummy_constraint'
,
expression
=
'python: object.getTitle() == "my_tales_constraint_title"'
)
dummy
.
Predicate_view
()
transaction
.
commit
()
# Recreate class with a newly added constraint
synchronizeDynamicModules
(
portal
,
force
=
True
)
# Load test_module
test_module
=
getattr
(
portal
,
'Test Migration'
)
test_module
.
objectValues
()
# Then close this new connection.
transaction
.
abort
()
con
.
close
()
# Delete all connections by force
# This code depends on ZODB implementation.
for
i
in
db
.
pool
.
available
[:]:
if
i
[
1
]
==
con
:
db
.
pool
.
available
.
remove
(
i
)
db
.
pool
.
all
.
remove
(
con
)
del
con
# Back to the default connection.
transaction
.
abort
()
self
.
app
.
_p_jar
.
_resetCache
()
setSite
(
old_site
)
# Call checkConsistency and make sure that ConnectionStateError does not occur.
self
.
assert_
(
self
.
test_module
.
checkConsistency
())
def
testAddEmptyProperty
(
self
):
def
testAddEmptyProperty
(
self
):
"""
"""
When users create properties in a PropertySheet, the property is
When users create properties in a PropertySheet, the property is
...
...
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