diff options
author | Elrond <elrond+mediagoblin.org@samba-tng.org> | 2011-10-16 00:25:59 +0200 |
---|---|---|
committer | Elrond <elrond+mediagoblin.org@samba-tng.org> | 2011-10-16 00:25:59 +0200 |
commit | adf7945081e1e15e22270fee7d2f2f14202799d5 (patch) | |
tree | 513b956b9a45afd72b386038013911471f9ac436 /mediagoblin/tests/test_csrf_middleware.py | |
parent | 471509197034e8aa3a2f4d3fa41e86212b543082 (diff) | |
download | mediagoblin-adf7945081e1e15e22270fee7d2f2f14202799d5.tar.lz mediagoblin-adf7945081e1e15e22270fee7d2f2f14202799d5.tar.xz mediagoblin-adf7945081e1e15e22270fee7d2f2f14202799d5.zip |
Hotfix: Renaming cookie broke unit tests
The name of the cookie was hardcoded in the unit tests and
while renaming the cookie this part was missed.
So now read the cookie_name from the config in the test.
This also tests for the config item existing!
Diffstat (limited to 'mediagoblin/tests/test_csrf_middleware.py')
-rw-r--r-- | mediagoblin/tests/test_csrf_middleware.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/mediagoblin/tests/test_csrf_middleware.py b/mediagoblin/tests/test_csrf_middleware.py index cf03fe58..691f10b9 100644 --- a/mediagoblin/tests/test_csrf_middleware.py +++ b/mediagoblin/tests/test_csrf_middleware.py @@ -26,12 +26,14 @@ from mediagoblin import mg_globals @setup_fresh_app def test_csrf_cookie_set(test_app): + cookie_name = mg_globals.app_config['csrf_cookie_name'] + # get login page response = test_app.get('/auth/login/') # assert that the mediagoblin nonce cookie has been set assert 'Set-Cookie' in response.headers - assert 'mediagoblin_nonce' in response.cookies_set + assert cookie_name in response.cookies_set # assert that we're also sending a vary header assert response.headers.get('Vary', False) == 'Cookie' |