Commit cf4287cf authored by Paul Winkler's avatar Paul Winkler

Removed duplicate code from ZopeTestCase.utils.makerequest;

it now wraps Testing.makerequest.makerequest().
parent f1f1e9b6
......@@ -127,25 +127,13 @@ def startZServer(number_of_threads=1, log=None):
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
# 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))
app = _makerequest(app, stdout=stdout, environ=environ)
return app
def appcall(function, *args, **kw):
'''Calls a function passing 'app' as first argument.'''
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment