Commit e056ca5c authored by Tim Peters's avatar Tim Peters

Convert subtransaction commits to savepoint creations.

Stops deprecation warnings from ZODB 3.6.

Still no idea why deprecation warnings from the ZODB tests
show up (ZODB is already trying to suppress them, and that
works fine in a ZODB checkout and in a Zope3 checkout).
parent d5ebc7c2
...@@ -50,7 +50,7 @@ def _getDB(): ...@@ -50,7 +50,7 @@ def _getDB():
root = conn.root() root = conn.root()
app = Application() app = Application()
root['Application']= app root['Application']= app
transaction.commit(1) transaction.savepoint(optimistic=True)
_populate(app) _populate(app)
stuff['db'] = db stuff['db'] = db
conn.close() conn.close()
...@@ -188,9 +188,10 @@ class TestSessionManager(TestBase): ...@@ -188,9 +188,10 @@ class TestSessionManager(TestBase):
def testSubcommit(self): def testSubcommit(self):
sd = self.app.session_data_manager.getSessionData() sd = self.app.session_data_manager.getSessionData()
sd.set('foo', 'bar') sd.set('foo', 'bar')
# TODO: transaction.commit() always returns None. Is that # TODO: this is used to test that transaction.commit(1) returned
# all this is trying to test? # None, but transaction.commit(whatever) always returns None (unless
self.failUnless(transaction.commit(1) == None) # there's an exception). What is this really trying to test?
transaction.savepoint(optimistic=True)
def testForeignObject(self): def testForeignObject(self):
self.assertRaises(InvalidObjectReference, self._foreignAdd) self.assertRaises(InvalidObjectReference, self._foreignAdd)
......
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