[Zope-dev] ZopeTestCase and interactions
    Martin Aspeli 
    optilude+lists at gmail.com
       
    Sun Jul 26 11:21:28 EDT 2009
    
    
  
Hi,
It seems that an integration test written using ZopeTestCase (and 
PloneTestCase) does not support using zope.security.checkPermission().
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()?
Cheers,
Martin
-- 
Author of `Professional Plone Development`, a book for developers who
want to work with Plone. See http://martinaspeli.net/plone-book
    
    
More information about the Zope-Dev
mailing list