transfer cookies from twill to zope
I'm trying to figure out a way to transfer cookies from a Twill browser instance to a Zope browser instance. They both are built on Mechanize, so this should be possible.
I have tried:
zopeBrowser = zope.testbrowser.browser.Browser()
twillBrowser = twill.commands.get_browser()
twillBrowser.go("http://example.com/") #开发者_如何转开发 got some cookies
zopeBrowser.mech_browser._ua_handlers['_cookies'].cookiejar = \
twillBrowser._browser._ua_handlers['_cookies'].cookiejar
But that doesn't seem to have worked.
Any ideas?
Thanks!
精彩评论