[Checkins] SVN: Zope/trunk/lib/python/Testing/ZopeTestCase/utils.py Removed duplicate code from ZopeTestCase.utils.makerequest;

Paul Winkler pw_lists at slinkp.com
Wed Apr 5 16:52:39 EDT 2006


Log message for revision 66582:
  Removed duplicate code from ZopeTestCase.utils.makerequest;
  it now wraps Testing.makerequest.makerequest().
  
  

Changed:
  U   Zope/trunk/lib/python/Testing/ZopeTestCase/utils.py

-=-
Modified: Zope/trunk/lib/python/Testing/ZopeTestCase/utils.py
===================================================================
--- Zope/trunk/lib/python/Testing/ZopeTestCase/utils.py	2006-04-05 20:51:21 UTC (rev 66581)
+++ Zope/trunk/lib/python/Testing/ZopeTestCase/utils.py	2006-04-05 20:52:39 UTC (rev 66582)
@@ -127,26 +127,14 @@
 
 def makerequest(app, stdout=sys.stdout):
     '''Wraps the app into a fresh REQUEST.'''
-    from ZPublisher.BaseRequest import RequestContainer
-    from ZPublisher.Request import Request
-    from ZPublisher.Response import Response
-    response = Response(stdout=stdout)
+    from Testing.makerequest import makerequest as _makerequest
     environ = {}
     environ['SERVER_NAME'] = _Z2HOST or 'nohost'
     environ['SERVER_PORT'] = '%d' % (_Z2PORT or 80)
     environ['REQUEST_METHOD'] = 'GET'
-    request = Request(sys.stdin, environ, response)
-    request._steps = ['noobject'] # Fake a published object
-    request['ACTUAL_URL'] = request.get('URL') # Zope 2.7.4
+    app = _makerequest(app, stdout=stdout, environ=environ)
+    return app
 
-    # set Zope3-style default skin so that the request is usable for
-    # Zope3-style view look-ups
-    from zope.app.publication.browser import setDefaultSkin
-    setDefaultSkin(request)
-
-    return app.__of__(RequestContainer(REQUEST=request))
-
-
 def appcall(function, *args, **kw):
     '''Calls a function passing 'app' as first argument.'''
     from base import app, close



More information about the Checkins mailing list