Commit 77ec9df2 authored by Vincent Pelletier's avatar Vincent Pelletier

Only testZODB requires a _db property.

Creating this property on other tests "pollutes" the database, as it
creates the root object.

git-svn-id: https://svn.erp5.org/repos/neo/trunk@1933 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent b9269b66
...@@ -16,7 +16,6 @@ ...@@ -16,7 +16,6 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
import unittest import unittest
import ZODB
from neo.tests.functional import NEOCluster, NEOFunctionalTest from neo.tests.functional import NEOCluster, NEOFunctionalTest
...@@ -31,10 +30,8 @@ class ZODBTestCase(NEOFunctionalTest): ...@@ -31,10 +30,8 @@ class ZODBTestCase(NEOFunctionalTest):
self.neo.setupDB() self.neo.setupDB()
self.neo.start() self.neo.start()
self._storage = self.neo.getZODBStorage() self._storage = self.neo.getZODBStorage()
self._db = ZODB.DB(self._storage)
def tearDown(self): def tearDown(self):
self._db.close()
self._storage.cleanup() self._storage.cleanup()
self.neo.stop() self.neo.stop()
......
...@@ -17,11 +17,19 @@ ...@@ -17,11 +17,19 @@
import unittest import unittest
from ZODB.tests import testZODB from ZODB.tests import testZODB
import ZODB
from neo.tests.zodb import ZODBTestCase from neo.tests.zodb import ZODBTestCase
class NEOZODBTests(ZODBTestCase, testZODB.ZODBTests): class NEOZODBTests(ZODBTestCase, testZODB.ZODBTests):
pass
def setUp(self):
super(NEOZODBTests, self).setUp()
self._db = ZODB.DB(self._storage)
def tearDown(self):
self._db.close()
super(NEOZODBTests, self).tearDown()
if __name__ == "__main__": if __name__ == "__main__":
suite = unittest.makeSuite(NEOZODBTests, 'check') suite = unittest.makeSuite(NEOZODBTests, 'check')
......
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