This is quite a useful little utility, but it creates a REQUEST object
any AUTHENTICATED_USER beign present.
Should this be remedied? If so, how?
Maybe it should be a parameter of the makerequest function.
I do have memories that REQUEST.AUTHENTICATED_USER has been deprecated. In
which, case, how should you get hold of the current user's object and can
be made to work in a testing environment?
from AccessControl import getSecurityManager
user = getSecurityManager().getUser()
And yes, this can be made to work in a testing environment. You'll always
get the Anonymous User from within a test, however.
For an example of a way to *set* the user with the same facility, see
CoreSessionTracking's SessionDataManager.EventWrapper.__call__ method.
Nirvana here would be not having to import Zope so that we can run tests
Zope is still up and running in a non-ZEO situation.
Does ZUnit help with this? If so, how?
Dunno. It's not really possible if you depend on database operations. This
is why it's important to factor your products into bits testable outside of
the Zope framework.
Zope-Dev maillist - [EMAIL PROTECTED]
** No cross posts or HTML encoding! **
(Related lists -