[Zope3-checkins]
SVN: Zope3/branches/testbrowser-integration/src/zope/testbrowser/testing.py
Updated to reflect new response API
Jim Fulton
jim at zope.com
Fri Sep 9 17:41:30 EDT 2005
Log message for revision 38436:
Updated to reflect new response API
Changed:
U Zope3/branches/testbrowser-integration/src/zope/testbrowser/testing.py
-=-
Modified: Zope3/branches/testbrowser-integration/src/zope/testbrowser/testing.py
===================================================================
--- Zope3/branches/testbrowser-integration/src/zope/testbrowser/testing.py 2005-09-09 16:43:19 UTC (rev 38435)
+++ Zope3/branches/testbrowser-integration/src/zope/testbrowser/testing.py 2005-09-09 21:41:29 UTC (rev 38436)
@@ -73,12 +73,19 @@
a ``urllib2`` compatible response, which is also understood by
mechanize.
"""
- headers = self.response.header_output.headersl
real_response = self.response._response
status = real_response.getStatus()
reason = real_response._reason # XXX add a getReason method
- output = (real_response.getHeaderText(real_response.getHeaders()) +
- self.response.getBody())
+
+ headers = real_response.getHeaders()
+ headers.sort()
+ output = (
+ "Status: %s\r\n%s\r\n\r\n%s" % (
+ real_response.getStatusString(),
+ '\r\n'.join([('%s: %s' % h) for h in headers]),
+ real_response.consumeBody(),
+ )
+ )
return PublisherResponse(output, status, reason)
More information about the Zope3-Checkins
mailing list