Commit 85398aa0 authored by Gary Poster's avatar Gary Poster

Fix small bug that the Connection.isReadOnly method did not work after a savepoint

parent edea5b56
......@@ -34,6 +34,8 @@ General
on datetimes or serials (TIDs). See
src/ZODB/historical_connections.txt.
- (3.9.0a1) Fixed small bug that the Connection.isReadOnly method didn't
work after a savepoint.
ZEO
---
......
......@@ -1175,6 +1175,7 @@ class TmpStore:
self._storage = storage
for method in (
'getName', 'new_oid', 'getSize', 'sortKey', 'loadBefore',
'isReadOnly'
):
setattr(self, method, getattr(storage, method))
......
......@@ -182,8 +182,8 @@
</description>
<key name="historical-pool-size" datatype="integer" default="3"/>
<description>
The expected maximum number of connections simultaneously open
per historical revision.
The expected maximum total number of historical connections
simultaneously open.
</description>
<key name="historical-cache-size" datatype="integer" default="1000"/>
<description>
......
......@@ -138,6 +138,21 @@ Verify all the values are as expected:
>>> db.close()
"""
def testIsReadonly():
"""\
The connection isReadonly method relies on the _storage to have an isReadOnly.
We simply rely on the underlying storage method.
>>> import ZODB.tests.util
>>> db = ZODB.tests.util.DB()
>>> connection = db.open()
>>> root = connection.root()
>>> root['a'] = 1
>>> sp = transaction.savepoint()
>>> connection.isReadOnly()
False
"""
def test_suite():
return unittest.TestSuite((
doctest.DocFileSuite('testConnectionSavepoint.txt'),
......
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