[Product-Developers] [plone.app.testing] Issue with z2.setRoles()

Martin Aspeli optilude+lists at gmail.com
Sat Feb 5 17:04:12 UTC 2011


Hi,

On 5 February 2011 16:45, Andreas Jung <lists at zopyx.com> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Hi there,
>
> I am trying to use plone.app.testing under Plone 4 for a decent AT-based
> content-type. How plone.app.testing is failing badly with the following
> setupPloneSite() call. Obviously there is some issue with the setRoles()
> call. The signature of setRoles() excepts a userfolder objects and not a
> portal object (documentation error?). Passing in portal.acl_users also
> does not help since the code will fail afterwards with a different error.

If you're using Plone, try to use

from plone.app.testing import setRoles

setRoles(portal, userId, roles)

This definitely takes the portal as an argument. (see
http://pypi.python.org/pypi/plone.app.testing).

You're using the similarly named plone.testing.z2.setRoles(), which
takes a userFolder (see http://pypi.python.org/pypi/plone.testing)
indeed.

Now, there are tests for both in plone.testing and plone.app.testing,
so I find it quite strange that you should get that error.

Did userFolderEditUser() suddenly disappear for any reason in Plone 4?

Martin



More information about the Product-Developers mailing list