2023-09-15 15:24:05 +00:00
|
|
|
from flask import g
|
|
|
|
|
|
|
|
|
2024-04-14 20:51:58 +00:00
|
|
|
def test_index(testclient, user, backend):
|
2023-09-15 15:24:05 +00:00
|
|
|
res = testclient.get("/", status=302)
|
|
|
|
assert res.location == "/login"
|
|
|
|
|
|
|
|
g.user = user
|
|
|
|
res = testclient.get("/", status=302)
|
|
|
|
assert res.location == "/profile/user"
|
|
|
|
|
2023-12-18 17:06:03 +00:00
|
|
|
testclient.app.config["CANAILLE"]["ACL"]["DEFAULT"]["PERMISSIONS"] = ["use_oidc"]
|
2024-04-14 20:51:58 +00:00
|
|
|
backend.reload(g.user)
|
2023-09-15 15:24:05 +00:00
|
|
|
res = testclient.get("/", status=302)
|
|
|
|
assert res.location == "/consent/"
|
|
|
|
|
2023-12-18 17:06:03 +00:00
|
|
|
testclient.app.config["CANAILLE"]["ACL"]["DEFAULT"]["PERMISSIONS"] = []
|
2024-04-14 20:51:58 +00:00
|
|
|
backend.reload(g.user)
|
2023-09-15 15:24:05 +00:00
|
|
|
res = testclient.get("/", status=302)
|
|
|
|
assert res.location == "/about"
|