← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] ~cjwatson/launchpad:zope.app.wsgi-4.3.0 into launchpad:master

 

Colin Watson has proposed merging ~cjwatson/launchpad:zope.app.wsgi-4.3.0 into launchpad:master.

Commit message:
Upgrade to zope.app.wsgi 4.3.0

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~cjwatson/launchpad/+git/launchpad/+merge/386915

This lets us drop our customised version of FakeResponse.

Dependencies MP: https://code.launchpad.net/~cjwatson/lp-source-dependencies/+git/lp-source-dependencies/+merge/386914
-- 
Your team Launchpad code reviewers is requested to review the proposed merge of ~cjwatson/launchpad:zope.app.wsgi-4.3.0 into launchpad:master.
diff --git a/constraints.txt b/constraints.txt
index bf65925..c282f40 100644
--- a/constraints.txt
+++ b/constraints.txt
@@ -332,7 +332,7 @@ zope.app.http==4.0.1
 zope.app.publication==4.3.1
 zope.app.publisher==4.2.0
 zope.app.server==4.0.0
-zope.app.wsgi==4.1.0
+zope.app.wsgi==4.3.0
 zope.server==4.0.2
 zope.testbrowser==5.5.1
 zope.vocabularyregistry==1.1.1
diff --git a/lib/lp/testing/pages.py b/lib/lp/testing/pages.py
index 63c7527..77a4059 100644
--- a/lib/lp/testing/pages.py
+++ b/lib/lp/testing/pages.py
@@ -40,7 +40,7 @@ from soupsieve import escape as css_escape
 import transaction
 from webtest import TestRequest
 from zope.app.wsgi.testlayer import (
-    FakeResponse as _FakeResponse,
+    FakeResponse,
     NotInBrowserLayer,
     )
 from zope.component import getUtility
@@ -101,30 +101,6 @@ SAMPLEDATA_ACCESS_SECRETS = {
     }
 
 
-class FakeResponse(_FakeResponse):
-    """A fake response for use in tests.
-
-    This is like `zope.app.wsgi.testlayer.FakeResponse`, but does a better
-    job of emulating `zope.app.testing.functional` by using the request's
-    `SERVER_PROTOCOL` in the response.
-    """
-
-    def __init__(self, response, request):
-        self.response = response
-        self.request = request
-
-    def getOutput(self):
-        output = super(FakeResponse, self).getOutput()
-        protocol = self.request.environ['SERVER_PROTOCOL']
-        if not isinstance(protocol, bytes):
-            protocol = protocol.encode('ISO-8859-1')
-        return (
-            (b'%s %s\n' % (protocol, self.response.status)) +
-            output.split(b'\n', 1)[1])
-
-    __str__ = getOutput
-
-
 def http(string, handle_errors=True):
     """Make a test HTTP request.