27 Jun
2003
27 Jun
'03
6:04 p.m.
Richard Jones wrote at 2003-6-27 15:21 +1000:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Is there any way to change the current user in Zope unit tests? I've managed to trace the current user down to SecurityManager._context.user, but reassigning that doesn't seem to make the change. Any hints?
Yes: from AccessControl.SecurityManagement import newSecurityManager newSecurityManager(None,user) "user" must be a wrapped (in its "acl_users" context) user object. Dieter