[Zope-dev] zope.testbrowser and WebTest (round 2)

Brian Sutherland brian at vanguardistas.net
Thu Mar 10 10:17:24 EST 2011


On Sat, Mar 05, 2011 at 01:07:58AM +0100, Jan-Jaap Driessen wrote:
> To get the groktoolkit tests and my company's applications to run with
> Brian's zope.testbrowser+webtest branch I did the following things:
> 
> * I created a branch of zope.app.wsgi trunk [1] to which I copied the
> AuthorizationMiddleware from zope.testbrowser trunk (moved there in
> [2]). The three middleware components (Transaction, Authorization and
> HandleErrors) are needed to make the groktoolkit tests pass. The
> AuthorizationMiddleware is not available on Brian's branch, but is
> available on zope.testbrowser trunk. If we can land this middleware in
> zope.testbrowser, we can again remove it from zope.app.wsgi.testlayer.
> In my opinion, this middleware should be part of zope.testbrowser,
> because handleErrors is part of the IBrowser interface.
> 
> * The `http caller` in zope.app.wsgi.testlayer is used in
> grokcore.rest. On my branch, I rewrote the http caller to use WebTest
> and _APP_UNDER_TEST instead of wsgi_intercept. The import from
> zope.testbrowser is bothering me; can we put the http caller in
> zope.testbrowser? The http caller returns a FakeResponse instance,
> which could very well be a WebTest TestResponse. The FakeResponse
> wrapper is merely used to fix the current tests.
> 
> * I fixed some tests in grok and grokcore.rest to use the
> WebTest-style http caller.

I was pretty sure you wouldn't mind so I committed a few cleanups and
bugfixes to your zope.app.wsgi branch.

The trunk ztk and zopeapp tests now also pass with the three branches.

-- 
Brian Sutherland


More information about the Zope-Dev mailing list