[Zope3-checkins] CVS: Zope3/src/zope/testing - functional.py:1.12

Marius Gedminas mgedmin@codeworks.lt
Thu, 31 Jul 2003 12:52:02 -0400


Update of /cvs-repository/Zope3/src/zope/testing
In directory cvs.zope.org:/tmp/cvs-serv29544/src/zope/testing

Modified Files:
	functional.py 
Log Message:
Do not cache the value returned by getRootFolder() as it may cause
ReadConflictErrors if a subsequent transaction updates something.


=== Zope3/src/zope/testing/functional.py 1.11 => 1.12 ===
--- Zope3/src/zope/testing/functional.py:1.11	Tue Jul 22 05:33:46 2003
+++ Zope3/src/zope/testing/functional.py	Thu Jul 31 12:51:57 2003
@@ -110,10 +110,6 @@
         self.db.close()
         storage = DemoStorage("Demo Storage", self.base_storage)
         self.db = self.app.db = DB(storage)
-        # Get hold of the root folder
-        self.connection = self.db.open()
-        root = self.connection.root()
-        self.root_folder = root[ZopePublication.root_name]
 
     def tearDown(self):
         """Cleans up after a functional test case."""
@@ -124,7 +120,9 @@
 
     def getRootFolder(self):
         """Returns the Zope root folder."""
-        return self.root_folder
+        self.connection = self.db.open()
+        root = self.connection.root()
+        return root[ZopePublication.root_name]
 
     def getApplication(self):
         """Returns the Zope application instance."""