[Checkins] SVN: Zope/branches/elro-parent-pointers/src/OFS/tests/testCopySupport.py Avoid makerequest so app is root object (other tests should also avoid this to match the new reality.)

Laurence Rowe l at lrowe.co.uk
Tue Nov 1 01:00:20 UTC 2011


Log message for revision 123224:
  Avoid makerequest so app is root object (other tests should also avoid this to match the new reality.)

Changed:
  U   Zope/branches/elro-parent-pointers/src/OFS/tests/testCopySupport.py

-=-
Modified: Zope/branches/elro-parent-pointers/src/OFS/tests/testCopySupport.py
===================================================================
--- Zope/branches/elro-parent-pointers/src/OFS/tests/testCopySupport.py	2011-11-01 00:54:04 UTC (rev 123223)
+++ Zope/branches/elro-parent-pointers/src/OFS/tests/testCopySupport.py	2011-11-01 01:00:19 UTC (rev 123224)
@@ -11,10 +11,11 @@
 from OFS.Application import Application
 from OFS.Folder import manage_addFolder
 from OFS.Image import manage_addFile
-from Testing.makerequest import makerequest
+from Testing.makerequest import newrequest
 from zope import component
 from zope.testing import cleanup
 from persistent import Persistent
+from zope.globalrequest import setRequest
 from zope.location import Location
 
 
@@ -82,7 +83,9 @@
             r['Application'] = a
             self.root = a
             responseOut = self.responseOut = cStringIO.StringIO()
-            self.app = makerequest( self.root, stdout=responseOut )
+            request = newrequest(stdout=responseOut)
+            setRequest(request)
+            self.app =  a
             manage_addFolder( self.app, 'folder1' )
             manage_addFolder( self.app, 'folder2' )
             folder1 = getattr( self.app, 'folder1' )
@@ -111,6 +114,7 @@
         del self.responseOut
         del self.root
         del self.connection
+        setRequest(None)
         cleanup.cleanUp()
 
 



More information about the checkins mailing list