fix seed user redirects

This commit is contained in:
Gergő Jedlicska
2022-10-26 16:45:24 +02:00
parent de29b93b8b
commit e6b1604bc3
+5 -1
View File
@@ -29,10 +29,14 @@ def seed_user(host):
r = requests.post(
url=f"http://{host}/auth/local/register?challenge=pyspeckletests",
data=user_dict,
# do not follow redirects here, they lead to the frontend, which might not be
# running in a test environment
# causing the response to not be OK in the end
allow_redirects=False
)
if not r.ok:
raise Exception(f"Cannot seed user: {r.reason}")
access_code = r.url.split("access_code=")[1]
access_code = r.text.split("access_code=")[1]
r_tokens = requests.post(
url=f"http://{host}/auth/token",