Projet

Général

Profil

0001-tests-non-regressions-test-for-opened-session-cookie.patch

Benjamin Dauvergne, 11 juin 2018 11:13

Télécharger (960 octets)

Voir les différences:

Subject: [PATCH 1/2] tests: non regressions test for opened session cookie on
 API calls (#24407)

 tests/test_api.py | 7 +++++++
 1 file changed, 7 insertions(+)
tests/test_api.py
819 819
    for role_dict in resp.json['results']:
820 820
        for field in role_fields:
821 821
            assert field in role_dict
822

  
823

  
824
def test_no_opened_session_cookie_on_api(app, user, settings):
825
    settings.A2_OPENED_SESSION_COOKIE_DOMAIN = 'localhost'
826
    app.authorization = ('Basic', (user.username, user.username))
827
    resp = app.get('/api/users/')
828
    assert 'A2_OPENED_SESSION' not in app.cookies
822
-