aboutsummaryrefslogtreecommitdiffstats
path: root/mediagoblin/tests
diff options
context:
space:
mode:
authorBen Sturmfels <ben@sturm.com.au>2015-08-24 20:47:33 +1000
committerChristopher Allan Webber <cwebber@dustycloud.org>2015-11-05 15:13:44 -0600
commitf51fd67a06054067b9eadde322ab06b0e84c2090 (patch)
tree6af7545d982f7c940efab656661fd99a29e3cd35 /mediagoblin/tests
parentbe2621a43c44b385a72b4d9905b4dc11435afe67 (diff)
downloadmediagoblin-f51fd67a06054067b9eadde322ab06b0e84c2090.tar.lz
mediagoblin-f51fd67a06054067b9eadde322ab06b0e84c2090.tar.xz
mediagoblin-f51fd67a06054067b9eadde322ab06b0e84c2090.zip
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.
Diffstat (limited to 'mediagoblin/tests')
-rw-r--r--mediagoblin/tests/test_csrf_middleware.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/mediagoblin/tests/test_csrf_middleware.py b/mediagoblin/tests/test_csrf_middleware.py
index a272caf6..4452112b 100644
--- a/mediagoblin/tests/test_csrf_middleware.py
+++ b/mediagoblin/tests/test_csrf_middleware.py
@@ -25,7 +25,7 @@ def test_csrf_cookie_set(test_app):
# assert that the mediagoblin nonce cookie has been set
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 response.headers.get('Vary', False) == 'Cookie'
@@ -34,7 +34,7 @@ def test_csrf_cookie_set(test_app):
# We need a fresh app for this test on webtest < 1.3.6.
# We do not understand why, but it fixes the tests.
# If we require webtest >= 1.3.6, we can switch to a non fresh app here.
-#
+#
# ... this comment might be irrelevant post-pytest-fixtures, but I'm not
# removing it yet in case we move to module-level tests :)
# -- cwebber