[Zope] Authentication from a script

Marius Gedminas marius@codeworks.lt
Thu, 7 Feb 2002 16:59:02 +0200


Hello,

We are using ZUnit for our automated unit test suite.  Some of the tests
are checking permission handling and therefore need to be able to
"impersonate" authenticated users.  Currently our code uses
REQUEST['AUTHENTICATED_USER'] everywhere and the tests (which are
basically external Python scripts) do

  from AccessControl.User import SimpleUser
  REQUEST['AUTHENTICATED_USER'] = SimpleUser('user', 'passwd',
                                             ('Role1', 'Role2'),())

However we are now planning to switch to the new API (SecurityGetUser
etc.), and it is unclear how we can substitute a different user object
in our tests.

Is it at all possible in Zope 2.5.0?

Marius Gedminas
-- 
"What's the name of the new OO COBOL -- an equivalent of C++?"
"ADD 1 TO COBOL GIVING COBOL"