Darryl Cousins wrote:
> Hi all,
> 
> In normal browser when logged in as a pau principal I am successfully
> redirected to the standard unauthorized view when accessing a view
> forbidden to the user.
> 
> But accessing the same view in tests using testbrowser and loggd in as
> the same principal I get: 
> 
>     Exception raised:
>     ...
>     HTTPError: HTTP Error 403: Forbidden
> 
> Any thoughts please?

The PAU is a local utility stored in your ZODB. Functional tests (e.g.
testbrowser tests) are run with an in-memory ZODB instance that's thrown
away after each test (sandbox). They don't see the PAU you have set up.

If you want to test authentication via your PAU in a test, the test
should first create and register a PAU, add the principal sources inside
and then add the principals (if necessary).

Alternatively, you can just the 'mgr:mgrpw' credentials for functional
tests.

Philipp

_______________________________________________
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users

Reply via email to