tests: non regressions test for opened session cookie on API calls (#24407)

This commit is contained in:
Benjamin Dauvergne 2018-06-11 10:47:07 +02:00
parent 2de81439a5
commit eb4530adcb
1 changed files with 7 additions and 0 deletions

View File

@ -819,3 +819,10 @@ def test_api_get_role_list(app, admin_ou1, role_ou1, role_random):
for role_dict in resp.json['results']:
for field in role_fields:
assert field in role_dict
def test_no_opened_session_cookie_on_api(app, user, settings):
settings.A2_OPENED_SESSION_COOKIE_DOMAIN = 'localhost'
app.authorization = ('Basic', (user.username, user.username))
resp = app.get('/api/users/')
assert 'A2_OPENED_SESSION' not in app.cookies