Commit 02b5e591 authored by Jim Fulton's avatar Jim Fulton

Include extra data in InvalidObjectReference exceptions to make

debugging easier.
parent 1a888ac3
......@@ -52,11 +52,14 @@ database open function, but this doesn't work:
>>> p2 = MyClass()
>>> conn2.root()['p'] = p2
>>> p2.p1 = p1
>>> tm.commit() # doctest: +NORMALIZE_WHITESPACE
>>> tm.commit() # doctest: +NORMALIZE_WHITESPACE +ELLIPSIS
Traceback (most recent call last):
...
InvalidObjectReference: Attempt to store a reference to an object
from a separate connection to the same database or multidatabase
InvalidObjectReference:
('Attempt to store a reference to an object from a separate connection to
the same database or multidatabase',
<Connection at ...>,
<ZODB.tests.testcrossdatabasereferences.MyClass object at ...>)
>>> tm.abort()
......@@ -68,11 +71,14 @@ different connections to the same database.
>>> p2 = MyClass()
>>> conn2.root()['p'] = p2
>>> p2.p1 = p1
>>> tm.commit() # doctest: +NORMALIZE_WHITESPACE
>>> tm.commit() # doctest: +NORMALIZE_WHITESPACE +ELLIPSIS
Traceback (most recent call last):
...
InvalidObjectReference: Attempt to store a reference to an object
from a separate connection to the same database or multidatabase
InvalidObjectReference:
('Attempt to store a reference to an object from a separate connection
to the same database or multidatabase',
<Connection at ...>,
<ZODB.tests.testcrossdatabasereferences.MyClass object at ...>)
>>> tm.abort()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment