Is there anything I need to do with the mech_browser attribute to send a
custom User-Agent header with zope.testbrowser.browser.Browser?

  >>> from zope.testbrowser.browser import Browser
  >>> b = Browser()
  >>> b.addHeader('User-Agent', 'Zope Test Browser')

Apache agent_logs reads: 'Python-urllib/2.5'

Setting the header on the mech_browser, also shows up as

  >>> b.mech_browser.request.add_header('User-Agent', 'Zope Test Browser')
  >>> b.mech_browser.request.headers
  {'User-agent': 'Zope Test Browser'}
  >>> b.mech_browser.request.headers


non-system python-2.5, virtualenv, easy_install zope.testbrowser

Zope3-users mailing list

Reply via email to