[Zope-dev] ZopeTestCase and interactions

Hanno Schlichting hanno at hannosch.eu
Sun Jul 26 12:28:34 EDT 2009


On Sun, Jul 26, 2009 at 5:21 PM, Martin Aspeli<optilude+lists at gmail.com> wrote:
> The problem is that the interaction threadlocal isn't set up, so you get
> an AttributeError.
>
> It's easy to fix: just call Products.Five.security.newInteraction()
> before the test is run.
>
> Is this something that should go into ZopeTestCase's setUp()?

The ZopeTestCase classes themselves don't set up any of the ZCML
structure right now and I'd like to keep it that way.

Isn't the placeless layer exactly for this use-case of getting some
"minimal integration" fixture set up? Since Zope 2.12 a Zope2 specific
version of that is in Testing.ZopeTestCase.placeless. Before you would
get it from zope.app.testing.placelesssetup.

The module in Testing.ZopeTestCase uses "from zope.security.management
import newInteraction" though and not Five. Maybe it should use the
Five version instead?

Hanno


More information about the Zope-Dev mailing list