From 4b6b81ae7ea0b598b300b0899ee58e5c06986f1f Mon Sep 17 00:00:00 2001 From: MeggyCal Date: Fri, 15 Jul 2022 15:08:51 +0200 Subject: [PATCH] align to newer Flask version in Flask 2.1.0 redirects remain relative https://flask.palletsprojects.com/en/2.1.x/changes/ --- tests/legacy/test_api_legacy.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/legacy/test_api_legacy.py b/tests/legacy/test_api_legacy.py index 5d6649c8..5462d067 100644 --- a/tests/legacy/test_api_legacy.py +++ b/tests/legacy/test_api_legacy.py @@ -379,7 +379,10 @@ def get(self): resp = client.get("/api") assert resp.status_code == 302 - assert resp.headers["Location"] == "http://localhost/" + if flask.__version__ >= "2.1.0": + assert resp.headers["Location"] == "/" + else: + assert resp.headers["Location"] == "http://localhost/" def test_calling_owns_endpoint_before_api_init(self): api = restx.Api()