From: Elrond Date: Sat, 15 Oct 2011 22:25:59 +0000 (+0200) Subject: Hotfix: Renaming cookie broke unit tests X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=adf7945081e1e15e22270fee7d2f2f14202799d5;p=mediagoblin.git 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! --- 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'