Proxy setting for zope.testbrowser
In mechanize we can set proxy like this:
br = mechanize.Browser()
br.set_proxies({"http": "joe:password@myproxy.example.com:3开发者_StackOverflow社区128",
"ftp": "proxy.example.com",})
How do we do the same for zope.testbrowser?
Many thanks!
zope.testbrowser
is a wrapper around mechanize, and you can reach the wrapped mechanize browser via the mech_browser
attribute:
browser.mech_browser.set_proxies(dict(
http="joe:password@myproxy.example.com:3128",
ftp="proxy.example.com",
))
Not tested, but the above should work.
精彩评论