trac#665: Upgrade to WebTest 2.0.18 and fix broken test test_csrf_cookie_set.

Test was failing due to API change in WebTest around accessing cookies set in the test client. These are now in `test_app.cookies`.

While there are currently 48 other tests failing, I've verified that before and after this change that the same number fail. I've also checked that no other tests use the old API for accessing test client cookies.

I've pinned to version 2.0.18. My understanding is that it's generally a good idea to pin to a specific version where possible to avoid the "why has this suddenly broken" type bugs. This also seems appropriate since WebTest appears to be very stable.
This commit is contained in:
Ben Sturmfels 2015-08-24 20:47:33 +10:00 committed by Christopher Allan Webber
parent be2621a43c
commit f51fd67a06
2 changed files with 3 additions and 3 deletions

View File

@ -25,7 +25,7 @@ def test_csrf_cookie_set(test_app):
# assert that the mediagoblin nonce cookie has been set # assert that the mediagoblin nonce cookie has been set
assert 'Set-Cookie' in response.headers assert 'Set-Cookie' in response.headers
assert cookie_name in response.cookies_set assert cookie_name in test_app.cookies
# assert that we're also sending a vary header # assert that we're also sending a vary header
assert response.headers.get('Vary', False) == 'Cookie' assert response.headers.get('Vary', False) == 'Cookie'

View File

@ -74,7 +74,7 @@ install_requires = [
'kombu', 'kombu',
'jinja2', 'jinja2',
'Babel>=1.3', 'Babel>=1.3',
'webtest<2', 'WebTest==2.0.18',
'ConfigObj', 'ConfigObj',
'Markdown', 'Markdown',
'sqlalchemy<0.9.0, >0.8.0', 'sqlalchemy<0.9.0, >0.8.0',