Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Revert "Fixed AttributeError when importing ``plone.testing.z2`` if `…

…`zope.testbrowser`` 4.x is used but not ``zope.app.testing``."

This reverts commit 7345b4e.
  • Loading branch information...
commit d57baf9b59cc355603d4016f46058fc5a92fca88 1 parent 7345b4e
@icemac authored
Showing with 3 additions and 8 deletions.
  1. +0 −3  CHANGES.txt
  2. +3 −5 src/plone/testing/_z2_testbrowser.py
View
3  CHANGES.txt
@@ -7,9 +7,6 @@ Changelog
- Broke dependency on `unittest2` for Python 2.7+ as all features of
`unittest2` are integrated in `unittest` there.
-- Fixed AttributeError when importing ``plone.testing.z2`` if
- ``zope.testbrowser`` 4.x is used but not ``zope.app.testing``.
-
4.0.3 (2011-11-24)
------------------
View
8 src/plone/testing/_z2_testbrowser.py
@@ -10,9 +10,7 @@
import mechanize
import pkg_resources
-# Using a from-import here to avoid an AttributeError below when using
-# zope.testbrowser 4.x without zope.app.testing:
-from zope.testbrowser.testing import PublisherConnection, PublisherResponse
+import zope.testbrowser.testing
import zope.testbrowser.browser
@@ -65,7 +63,7 @@ def connectionFactory(host, timeout=None):
return Zope2Connection(self.app, host, timeout=timeout)
return self.do_open(connectionFactory, req)
-class Zope2Connection(PublisherConnection):
+class Zope2Connection(zope.testbrowser.testing.PublisherConnection):
"""A urllib2-compatible connection that can talk to the Zope 2 publisher.
"""
@@ -107,7 +105,7 @@ def getresponse(self):
headers = '\r\n'.join('%s: %s' % h for h in headers)
content = self.response.getBody()
- return PublisherResponse(content, headers, status, reason)
+ return zope.testbrowser.testing.PublisherResponse(content, headers, status, reason)
def saveState(func):
"""Save threadlocal state (security manager, local component site) before
Please sign in to comment.
Something went wrong with that request. Please try again.