Merge ~cjwatson/launchpad:simplify-appserverlayer-browser into launchpad:master
Status: | Merged |
---|---|
Approved by: | Colin Watson |
Approved revision: | d505382bc5f0034288888bab9a206ecaae864869 |
Merge reported by: | Otto Co-Pilot |
Merged at revision: | not available |
Proposed branch: | ~cjwatson/launchpad:simplify-appserverlayer-browser |
Merge into: | launchpad:master |
Diff against target: |
442 lines (+84/-123) 10 files modified
constraints.txt (+1/-0) lib/lp/services/webapp/tests/no-anonymous-session-cookies.txt (+5/-1) lib/lp/services/webapp/tests/test_cookie_authentication.py (+3/-7) lib/lp/services/webapp/tests/test_login.py (+17/-26) lib/lp/services/webapp/tests/test_no_anonymous_session_cookies.py (+3/-7) lib/lp/services/webservice/doc/launchpadlib.txt (+2/-1) lib/lp/services/webservice/tests/test_doc.py (+3/-5) lib/lp/testing/browser.py (+33/-76) lib/lp/testing/layers.py (+16/-0) setup.py (+1/-0) |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Ioana Lasc (community) | Approve | ||
Review via email:
|
Commit message
Refactor lp.testing.browser using zope.testbrowse
This test browser instance is used for a few tests that use
AppServerLayer and make out-of-process connections to the test app
server via a test browser.
The old mechanize-based test browser is going away, so we need to do
something. A reasonably future-proof approach seems to be to use the
new WSGI test browser and fool it into connecting to the app server
using WSGIProxy2 (which in fact WebTest also uses in some situations).
We'll still need some slight adjustments here to upgrade to newer
versions of zope.testbrowser, but they should be much more manageable.
We do need to take some special care in a few places:
* TestOpenIDRepla
For now, we switch off redirect handling entirely and follow
redirections manually; this will need further rearrangements for
zope.testbrowser >= 5.0.0.
* Both the httplib and the requests clients offered by WSGIProxy2
incorrectly fold multiple Set-Cookie headers in the response into
one, joining them with commas; this causes test failures.
Fortunately, the urllib3 client doesn't have this flaw, but we do
need to take care to disable certificate verification.
* The new WSGI test browser needs to be monkey-patched to allow talking
to our various test hosts, as by default it only allows localhost,
127.0.0.1, *.example.com, *.example.net, and *.example.org.