[Zope3-Users] Getting started with testbrowser

Darryl Cousins darryl at darrylcousins.net.nz
Wed Jun 28 00:59:01 EDT 2006


Hi again,

Sorry, I made an error in the previous post when I stated that
ftesting.zcml is not being parsed. It is in fact being parsed.

But I still can't figure why the authentication header is not allowing
the testbrowser object to 'view' @@contents.html.

Regards,
Darryl Cousins

On Wed, 2006-06-28 at 15:35 +1200, Darryl Cousins wrote:
> Hi All,
> 
> I'm having trouble getting started with testbrowser.
> 
> The problem is that zopeinstance/etc/ftesting.zcml is not being read.
> Could someone help me get started here please?
> 
> The doc test - 
> zopeinstance/lib/python/mypkg/browser/README.txt:
> 
>     >>> from zope.testbrowser import Browser
>     >>> browser = Browser()
>     >>> browser.addHeader('Authorization', 'Basic mgr:mgrpw')
>     >>> browser = Browser('http://localhost/contents.html')
> 
> The testrunner - 
> zopeinstance/lib/python/mypkg/browser/ftests.py:
> 
> def test_suite():
>     return unittest.TestSuite((
>         FunctionalDocFileSuite(
>             "README.txt",
>             optionflags=doctest.ELLIPSIS |
> doctest.NORMALIZE_WHITESPACE),
>         ))
> 
> And from zopeinstance/ I run the test:
> ./bin/test -vv -s mypkg/browser
> 
> I get HTTPError: HTTP Error 401: Unauthorized
> 
> Which suggests that zopeinstance/etc/ftesting.zcml is not being parsed
> (I tested that by putting bad data in ftesting.zcml which produced no
> error).
> 
> Best regards,
> Darryl Cousins
> 
> _______________________________________________
> 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