From e6b1604bc3792ad32541929cdfd85bc572426cda Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gerg=C5=91=20Jedlicska?= Date: Wed, 26 Oct 2022 16:45:24 +0200 Subject: [PATCH] fix seed user redirects --- tests/conftest.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/conftest.py b/tests/conftest.py index 63667c4..3dbfe01 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -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",