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!
This commit is contained in:
parent
4715091970
commit
adf7945081
@ -26,12 +26,14 @@ from mediagoblin import mg_globals
|
|||||||
@setup_fresh_app
|
@setup_fresh_app
|
||||||
def test_csrf_cookie_set(test_app):
|
def test_csrf_cookie_set(test_app):
|
||||||
|
|
||||||
|
cookie_name = mg_globals.app_config['csrf_cookie_name']
|
||||||
|
|
||||||
# get login page
|
# get login page
|
||||||
response = test_app.get('/auth/login/')
|
response = test_app.get('/auth/login/')
|
||||||
|
|
||||||
# assert that the mediagoblin nonce cookie has been set
|
# assert that the mediagoblin nonce cookie has been set
|
||||||
assert 'Set-Cookie' in response.headers
|
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 that we're also sending a vary header
|
||||||
assert response.headers.get('Vary', False) == 'Cookie'
|
assert response.headers.get('Vary', False) == 'Cookie'
|
||||||
|
Loading…
x
Reference in New Issue
Block a user