[Product-Developers] Problem with roles and plone.app.testing

Martin Aspeli optilude at gmail.com
Tue May 31 21:59:24 UTC 2011


On 31 May 2011 20:45, Noe Nieto <nnieto at noenieto.com> wrote:
> 2011/5/31 Martin Aspeli <optilude at gmail.com>
>>
>>
>> On 31 May 2011, at 18:09, Noe Nieto <nnieto at noenieto.com> wrote:
>>
>> On one of my tests I'm trying to create some folders.  This is the layer
>> class:
>> # ... adequate python imports
>> class CatalogosFixture(PloneSandboxLayer):
>>     defaultBases = (PLONE_FIXTURE,)
>>
>>     def setUpZope(self, app, configurationContext):
>>         # Load ZCML for product dependencies
>>         .....
>>
>>     def setUpPloneSite(self, portal):
>>         #Install products and dependencies
>>         self.applyProfile(portal, 'plone.app.dexterity:default')
>>         self.applyProfile(portal,'holokinesislibros.contenttypes:default')
>>         self.applyProfile(portal,'holokinesislibros.catalogos:default')
>>
>>         #Create a layout for testing
>>         from plone.app.testing import setRoles
>>         from plone.app.testing import TEST_USER_NAME
>>         setRoles(portal, TEST_USER_NAME, ['Manager'])
>>
>>
>> Use TEST_USER_ID. See docs for more.
>>
>
> The docs
> in http://pypi.python.org/pypi/plone.app.testing/1.0a1#permissions-and-roles
> adviced me to use TEST_USER_NAME. Now I understand why I should use
> TEST_USER_ID.
> It works now. Thanks.

We're now on version 4.0 ;-)

http://pypi.python.org/pypi/plone.app.testing/

Martin


More information about the Product-Developers mailing list