[Zope-CMF] Re: GenericSetup now incompatible with Zope 2.8?
yuppie
y.2006_ at wcm-solutions.de
Wed Jun 7 04:11:27 EDT 2006
Hi Philipp!
Philipp von Weitershausen wrote:
> yuppie wrote:
>>
>> Should be fixed now: http://svn.zope.org/?rev=68474&view=rev
>
> Simply avoiding the cleanup in Zope 2.8 isn't a proper fix. You should
> instead do the following (which works across all Zopes):
>
> from zope.testing.cleanup import CleanUp
> CleanUp().cleanUp()
Thanks for keeping an eye on these checkins, but I believe in this case
it is a proper fix. You just can't see it in the diff. There is nothing
to clean up in Zope 2.8. These tests require the traversing setup only
in Zope 2.10 and a separate 'traversing.zcml' does not exist in earlier
Zope/Five versions. I attached the complete code.
Cheers,
Yuppie
class SecurityRequestTest(ZopeTestCase):
def setUp(self):
import Products
from AccessControl.SecurityManagement import newSecurityManager
ZopeTestCase.setUp(self)
try:
# BBB: for Zope 2.9
from Products.Five.traversable import FiveTraversable
except ImportError:
zcml.load_config('meta.zcml', Products.Five)
zcml.load_config('traversing.zcml', Products.Five)
self.root = self.app
newSecurityManager(None,
OmnipotentUser().__of__(self.app.acl_users))
def tearDown(self):
from AccessControl.SecurityManagement import noSecurityManager
noSecurityManager()
ZopeTestCase.tearDown(self)
try:
from zope.testing.cleanup import cleanUp
cleanUp()
except ImportError:
# BBB: for Zope 2.8
pass
More information about the Zope-CMF
mailing list