[Zope] Zope unit testing - users?

Dieter Maurer dieter@handshake.de
Fri, 27 Jun 2003 20:04:31 +0200


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