SVN: Zope/trunk/src/Testing/ZopeTestCase/functional.py - re-added 'extra' argument (someone was missing it)

Yvo Schubbe <[email protected]>
Newsgroups gmane.comp.web.zope.cvs
Message-ID <20110608153002.3F85A94219__14448.8810598434$1307547012$gmane$org@cvs.zope.org>
Log message for revision 121896:
  - re-added 'extra' argument (someone was missing it)

Changed:
  U   Zope/trunk/src/Testing/ZopeTestCase/functional.py

-=-
Modified: Zope/trunk/src/Testing/ZopeTestCase/functional.py
===================================================================
--- Zope/trunk/src/Testing/ZopeTestCase/functional.py	2011-06-08 15:29:04 UTC (rev 121895)
+++ Zope/trunk/src/Testing/ZopeTestCase/functional.py	2011-06-08 15:30:01 UTC (rev 121896)
@@ -53,11 +53,12 @@
     implements(interfaces.IFunctional)
 
     @savestate
-    def publish(self, path, basic=None, env=None, request_method='GET',
-                stdin=None, handle_errors=True):
+    def publish(self, path, basic=None, env=None, extra=None,
+                request_method='GET', stdin=None, handle_errors=True):
         '''Publishes the object at 'path' returning a response object.'''
 
         from StringIO import StringIO
+        from ZPublisher.Request import Request
         from ZPublisher.Response import Response
         from ZPublisher.Publish import publish_module
 
@@ -66,6 +67,8 @@
 
         if env is None:
             env = {}
+        if extra is None:
+            extra = {}
 
         request = self.app.REQUEST
 
@@ -89,12 +92,14 @@
 
         outstream = StringIO()
         response = Response(stdout=outstream, stderr=sys.stderr)
+        request = Request(stdin, env, response)
+        for k, v in extra.items():
+            request[k] = v
 
         publish_module('Zope2',
+                       debug=not handle_errors,
+                       request=request,
                        response=response,
-                       stdin=stdin,
-                       environ=env,
-                       debug=not handle_errors,
                       )
 
         return ResponseWrapper(response, outstream, path)

_______________________________________________
Zope-Checkins maillist  -  [email protected]
https://mail.zope.org/mailman/listinfo/zope-checkins
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.