aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Spaeth <Sebastian@SSpaeth.de>2012-12-11 15:38:28 +0100
committerSebastian Spaeth <Sebastian@SSpaeth.de>2012-12-11 15:38:28 +0100
commitd24a82970ea34d90b684e1adaf9ddebacf215b89 (patch)
tree585d8490969197fba1cba81c4d46f805c95198f9
parent78fd5581a9fec142a1236eb90508724281f7f5ba (diff)
downloadmediagoblin-d24a82970ea34d90b684e1adaf9ddebacf215b89.tar.lz
mediagoblin-d24a82970ea34d90b684e1adaf9ddebacf215b89.tar.xz
mediagoblin-d24a82970ea34d90b684e1adaf9ddebacf215b89.zip
Fix CSRF tests with webtest 1.4.0
CSRF tests apparently passed with earlier versions of webtest, but failed with the latest webtest (1.4.0) package. It choked on passing a "key=value; " cookie as it split at the semicolon and failed to find additional values or something like that. Removing the semicolon makes this test pass. Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
-rw-r--r--mediagoblin/tests/test_csrf_middleware.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/mediagoblin/tests/test_csrf_middleware.py b/mediagoblin/tests/test_csrf_middleware.py
index ad433fe8..d730909f 100644
--- a/mediagoblin/tests/test_csrf_middleware.py
+++ b/mediagoblin/tests/test_csrf_middleware.py
@@ -44,7 +44,7 @@ def test_csrf_token_must_match(test_app):
# construct a request with a cookie, but no form token
assert test_app.post('/auth/login/',
- headers={'Cookie': str('%s=foo; ' %
+ headers={'Cookie': str('%s=foo' %
mg_globals.app_config['csrf_cookie_name'])},
extra_environ={'gmg.verify_csrf': True},
expect_errors=True).status_int == 403
@@ -52,7 +52,7 @@ def test_csrf_token_must_match(test_app):
# if both the cookie and form token are provided, they must match
assert test_app.post('/auth/login/',
{'csrf_token': 'blarf'},
- headers={'Cookie': str('%s=foo; ' %
+ headers={'Cookie': str('%s=foo' %
mg_globals.app_config['csrf_cookie_name'])},
extra_environ={'gmg.verify_csrf': True},
expect_errors=True).\
@@ -60,7 +60,7 @@ def test_csrf_token_must_match(test_app):
assert test_app.post('/auth/login/',
{'csrf_token': 'foo'},
- headers={'Cookie': str('%s=foo; ' %
+ headers={'Cookie': str('%s=foo' %
mg_globals.app_config['csrf_cookie_name'])},
extra_environ={'gmg.verify_csrf': True}).\
status_int == 200