2023-09-15 15:24:05 +00:00
|
|
|
from flask import g
|
|
|
|
|
|
|
|
|
|
|
|
def test_index(testclient, user):
|
|
|
|
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"]
|
2023-09-15 15:24:05 +00:00
|
|
|
g.user.reload()
|
|
|
|
res = testclient.get("/", status=302)
|
|
|
|
assert res.location == "/consent/"
|
|
|
|
|
2023-12-18 17:06:03 +00:00
|
|
|
testclient.app.config["CANAILLE"]["ACL"]["DEFAULT"]["PERMISSIONS"] = []
|
2023-09-15 15:24:05 +00:00
|
|
|
g.user.reload()
|
|
|
|
res = testclient.get("/", status=302)
|
|
|
|
assert res.location == "/about"
|