Closed nidico closed 11 years ago
Thanks nidico. Could you please add a test which recreates this behavior?
@kedder: Sure - I'm just not getting the test suite to run - bin/test
yields:
ImportError: cannot import name pystone
I've built zope.testbrowser in a virtualenv using the enclosed buildout configuration. Any idea?
If you can't get buildout to work, you may try tox (or detox) instead for running tests.
I've never seen the 'cannot import name pystone' error. It looks like somehow the Python stdib's test package gets mixed in where it shouldn't. If you could pastebin the full traceback somewhere, maybe that could shine some light on the issue.
I've moved my build / test problems to a separate issue - #5.
I've now added some tests which confirm the expected behavior.
@kedder / @mgedmin: Could you please have another look at this and merge if appropriate? Thanks!
Have you signed the Zope Committer Agreement? I don't think I'm allowed to merge code from people who haven't signed it.
(Unless it's a trivial change, but I don't know if this counts. /cc: @jimfulton)
@mgedmin:
Have you signed the Zope Committer Agreement?
Not yet, but I'll do as soon as http://foundation.zope.org/agreements is accessible again.
@mgedmin: My committer agreement has been signed and approved. Thanks for your support!
Thanks!
@nidico, I suspect the upcoming zope.testbrowser release is going to cause you pain: it switches the backend from mechanize (which doesn't support Python 3 and is barely maintained) to WebTest (which does and is). This means the '.mech_browser' attribute is going away.
I suspect you want a new API in zope.testbrowser itself, Browser.handleRedirects = False. Is that so?
It should be a simple change in Browser._processRequest(). The existing test_no_redirect will serve perfectly well as a unit test for this new API. I can make the change myself, but it would be better if you could test it with your existing test suite -- perhaps you'll discover other incompatibilities in the upcoming zope.testbrowser 4.1.0.
If an HTTPError is raised on
browser.submit
, it should only be reraised to the user ifbrowser.raiseHttpErrors=True
.This behavior already applies to
browser.open
, thus it is expected to apply tobrowser.submit
as well.