[Zope3-Users] functional doctest and testbowser with zopeproject
Douglas Cerna
douglascerna at yahoo.com
Tue Mar 31 17:09:34 EDT 2009
Hi.
I had a similar error and fixed it modifying:
>>> browser.addHeader('Authorization', 'Basic mgr:mgrpw')
To:
>>> browser.addHeader('Authorization', 'Basic globalmgr:globalmgrpw')
Both principals are defined in the ftesting.zcml file of your project, but just the globalmgr has the Manager role assigned.
Hope this helps.
Douglas
"... allí es cuando te das cuenta que las cosas malas pueden resultar bastante buenas..." - Lionel Messi
Por favor, evite enviarme adjuntos de Word, Excel o PowerPoint.
Vea http://www.gnu.org/philosophy/no-word-attachments.es.html
--- On Tue, 3/31/09, Lothar Pfeiler <lpfeiler at gmx.de> wrote:
> From: Lothar Pfeiler <lpfeiler at gmx.de>
> Subject: [Zope3-Users] functional doctest and testbowser with zopeproject
> To: zope3-users at zope.org
> Date: Tuesday, March 31, 2009, 8:05 AM
> Hi all,
>
> I created my dev environment with zopeproject. I tried to
> create a
> functional doctest with the following lines:
>
> >>> from zope.testbrowser.testing import Browser
>
> >>> browser = Browser()
> >>> browser.addHeader('Authorization',
> 'Basic mgr:mgrpw')
> >>>
> browser.open('http://localhost/manage')
>
>
> I get the following error for the last line.
>
> File
> "build/bdist.macosx-10.3-fat/egg/mechanize/_mechanize.py",
> line 261, in
> _mech_open
> httperror_seek_wrapper: HTTP Error 403: Forbidden
>
> Before I came to this point I first had to add the path to
> the
> zope.testbrowser package to sys.path inside the test
> script.
> Second I had to install mechanize. Now, I came to this
> point.
>
> Im working on Mac OS X with Python 2.4.4
>
> Can somebody help me?
>
> Thanks,
> Lothar
> _______________________________________________
> Zope3-users mailing list
> Zope3-users at zope.org
> http://mail.zope.org/mailman/listinfo/zope3-users
More information about the Zope3-users
mailing list