[Zope3-checkins] CVS: Zope3/src/zope/publisher - browser.py:1.18

Jim Fulton jim@zope.com
Thu, 22 May 2003 18:48:34 -0400


Update of /cvs-repository/Zope3/src/zope/publisher
In directory cvs.zope.org:/tmp/cvs-serv12508/src/zope/publisher

Modified Files:
	browser.py 
Log Message:
Made it possible to pass the form dictionary to the TestRequest
constructor to facilitate writing tests.


=== Zope3/src/zope/publisher/browser.py 1.17 => 1.18 ===
--- Zope3/src/zope/publisher/browser.py:1.17	Fri Apr 25 06:36:38 2003
+++ Zope3/src/zope/publisher/browser.py	Thu May 22 18:48:34 2003
@@ -707,8 +707,12 @@
     use_redirect = 1
 
 class TestRequest(BrowserRequest):
+    """Browser request with a constructor convenient for testing
+    """
 
-    def __init__(self, body_instream=None, outstream=None, environ=None, **kw):
+    def __init__(self,
+                 body_instream=None, outstream=None, environ=None, form=None,
+                 **kw):
 
         _testEnv =  {
             'SERVER_URL':         'http://127.0.0.1',
@@ -730,7 +734,8 @@
             outstream = StringIO()
 
         super(TestRequest, self).__init__(body_instream, outstream, _testEnv)
-
+        if form:
+            self.form.update(form)
 
 class BrowserResponse(HTTPResponse):
     """Browser response