Commit 11c56608 authored by Wichert Akkerman's avatar Wichert Akkerman

Update Five's testbrowser to support both mechanize 0.1.x and 0.2.x.

parent db63355c
...@@ -11,6 +11,8 @@ http://docs.zope.org/zope2/releases/. ...@@ -11,6 +11,8 @@ http://docs.zope.org/zope2/releases/.
Bugs Fixed Bugs Fixed
++++++++++ ++++++++++
- Update Five's testbrowser to support both mechanize 0.1.x and 0.2.x.
- Five's processInputs() would stomp on :list or :tuple values that contained - Five's processInputs() would stomp on :list or :tuple values that contained
ints or other non-strings, would clear out :records entirely, and would not ints or other non-strings, would clear out :records entirely, and would not
do anything for :record fields. do anything for :record fields.
......
...@@ -95,15 +95,10 @@ class PublisherMechanizeBrowser(mechanize.Browser): ...@@ -95,15 +95,10 @@ class PublisherMechanizeBrowser(mechanize.Browser):
'_equiv', '_basicauth', '_digestauth' ] '_equiv', '_basicauth', '_digestauth' ]
def __init__(self, *args, **kws): def __init__(self, *args, **kws):
inherited_handlers = ['_unknown', '_http_error', self.handler_classes = mechanize.Browser.handler_classes.copy()
'_http_request_upgrade', '_http_default_error', '_basicauth', self.handler_classes["http"] = PublisherHTTPHandler
'_digestauth', '_redirect', '_cookies', '_referer', self.default_others = [cls for cls in self.default_others
'_refresh', '_equiv', '_gzip'] if cls in mechanize.Browser.handler_classes]
self.handler_classes = {"http": PublisherHTTPHandler}
for name in inherited_handlers:
self.handler_classes[name] = mechanize.Browser.handler_classes[name]
mechanize.Browser.__init__(self, *args, **kws) mechanize.Browser.__init__(self, *args, **kws)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment