[Zope3-Users] Re: pau, testbrowser, HTTP Error 403: Forbidden

Darryl Cousins darryl at darrylcousins.net.nz
Sun Aug 27 08:14:55 EDT 2006


Hi Philipp,

My choice of words is poor. No, I am not redirected, the url remains the
same as typed but I do get a view which displays text saying
'Unauthorised, you are not' etc from
zope/app/exception/browser/unauthorized.pt but the testbrowser doesn't
give me this view. This behaviour suprised me and I don't yet see how to
use the test.

    >>> print
browser.open('http://localhost/tfws/categories/cotton/edit.html')
    >>> 'Unauthorized' in browser.contents
    True

Doesn't pass and

    >>> print
browser.open('http://localhost/tfws/categories/cotton/edit.html')
    Exception raised:
    ...
    HTTPError: HTTP Error 403: Forbidden

Doesn't pass. I can't figure how to use the test to test for what I
expect - which is of course an exception.

Sorry for the bother.

Regards,
Darryl

On Sun, 2006-08-27 at 14:00 +0200, Philipp von Weitershausen wrote:
> Darryl Cousins wrote:
> > Hi Philipp,
> > 
> > Yup. Sorry I was unclear, I mean that in a browser (ZMI) I am redirected
> > to the view which displays "Unauthorised, you are not authorised' or
> > similar. I am suprised therefore that I don't get the same view with
> > testbrowser.
> 
> Again, you're *not* redirected. Try to provoke an Unauthorized exception
> in a browser and watch the URL. It doesnt' change. Exception views are
> always displayed in place of the view you're supposed to see. There's no
> redirect.
> 
> Philipp



More information about the Zope3-users mailing list