canaille-globuzma/tests/test_consent.py

21 lines
577 B
Python
Raw Normal View History

2020-09-17 10:01:21 +00:00
def test_no_logged_no_access(testclient):
testclient.get("/consent", status=403)
2020-10-29 08:11:48 +00:00
def test_consent_list(
testclient, slapd_connection, client, consent, logged_user, token
):
2020-10-30 18:19:34 +00:00
res = testclient.get("/consent", status=200)
2020-09-17 10:01:21 +00:00
assert client.oauthClientName in res.text
assert not token.revoked
res = testclient.get(f"/consent/delete/{consent.cn[0]}")
assert 302 == res.status_code
res = res.follow()
assert 200 == res.status_code
assert client.oauthClientName not in res.text
token.reload(conn=slapd_connection)
assert token.revoked