[Zope-Checkins] SVN: Zope/trunk/src/Testing/ZopeTestCase/functional.py - re-added 'extra' argument (someone was missing it)
Yvo Schubbe
y.2011 at wcm-solutions.de
Wed Jun 8 11:30:02 EDT 2011
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)
More information about the Zope-Checkins
mailing list