[Zope3-Users] Re: zope.testbrowser and ZMI?
Basil Shubin
basil.shubin at gmail.com
Fri Mar 2 00:41:27 EST 2007
Philipp von Weitershausen wrote:
> Stephan Richter wrote:
>> On Thursday 01 March 2007 10:17, Basil Shubin wrote:
>>>>> >>> browser.addHeader('Authorization', 'Basic admin:admin')
>>
>> This authorization is not correct. You need to use:
>>
>> >>> manager.addHeader('Authorization', 'Basic mgr:mgrpw')
>>
>> At least this is the default.
>
> In most Zope 3 ftest layers it is. I believe he's on Zope2, though.
>
> I think his problem is that he's using the Zope 3 test browser in Zope
> 2. He should be using Products.Five.testbrowser.Browser.
>>> from Five.testbrowser import Browser
>>> browser = Browser()
>>> browser.addHeader('Authorization', 'Basic mgr:mgrpw')
>>> browser.open('http://localhost:8080/manage')
Loading Zope, please stand by ... done (3.729s)
Traceback (most recent call last):
File "<stdin>", line 1, in ?
File
"/home/bashu/workspace/gadoz-shared/zope2.10/lib/python/zope/testbrowser/browser.py",
line 220, in open
File
"/home/bashu/workspace/gadoz-shared/zope2.10/lib/python/mechanize/_mechanize.py",
line 177, in open
File
"/home/bashu/workspace/gadoz-shared/zope2.10/lib/python/mechanize/_mechanize.py",
line 202, in _mech_open
File
"/home/bashu/workspace/gadoz-shared/zope2.10/lib/python/mechanize/_opener.py",
line 234, in open
File "/usr/lib/python2.4/urllib2.py", line 376, in _open
'_open', req)
File "/usr/lib/python2.4/urllib2.py", line 337, in _call_chain
result = func(*args)
File
"/home/bashu/work/gadoz/gadoz-shared/products/Five-1.5/Five/testbrowser.py",
line 64, in http_open
return self.do_open(PublisherConnection, req)
File "/usr/lib/python2.4/urllib2.py", line 993, in do_open
h.request(req.get_method(), req.get_selector(), req.data, headers)
File
"/home/bashu/workspace/gadoz-shared/zope2.10/lib/python/zope/testbrowser/testing.py",
line 80, in request
File
"/home/bashu/workspace/gadoz-shared/zope2.10/lib/python/Testing/ZopeTestCase/zopedoctest/functional.py",
line 197, in http
File
"/home/bashu/workspace/gadoz-shared/zope2.10/lib/python/Testing/ZopeTestCase/zopedoctest/functional.py",
line 110, in sync
AttributeError: 'NoneType' object has no attribute '_p_jar'
Totaly confused, again!
More information about the Zope3-users
mailing list