From adf7945081e1e15e22270fee7d2f2f14202799d5 Mon Sep 17 00:00:00 2001 From: Elrond Date: Sun, 16 Oct 2011 00:25:59 +0200 Subject: [PATCH] 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! --- mediagoblin/tests/test_csrf_middleware.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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' -- 2.25.1