From ea45242604255799ed6fca6539a59f1df53e435c Mon Sep 17 00:00:00 2001 From: Robbe Sneyders Date: Mon, 4 Apr 2022 18:52:37 +0200 Subject: [PATCH] Update tests for changed werkzeug behavior in 2.1 (#1506) https://github.com/pallets/werkzeug/issues/2352 --- tests/api/test_headers.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/api/test_headers.py b/tests/api/test_headers.py index 0eb64ed63..87cdafae2 100644 --- a/tests/api/test_headers.py +++ b/tests/api/test_headers.py @@ -6,7 +6,8 @@ def test_headers_jsonifier(simple_app): response = app_client.post('/v1.0/goodday/dan', data={}) # type: flask.Response assert response.status_code == 201 - assert response.headers["Location"] == "http://localhost/my/uri" + # Default Werkzeug behavior was changed in 2.1 (https://github.com/pallets/werkzeug/issues/2352) + assert response.headers["Location"] in ["http://localhost/my/uri", "/my/uri"] def test_headers_produces(simple_app): @@ -14,7 +15,8 @@ def test_headers_produces(simple_app): response = app_client.post('/v1.0/goodevening/dan', data={}) # type: flask.Response assert response.status_code == 201 - assert response.headers["Location"] == "http://localhost/my/uri" + # Default Werkzeug behavior was changed in 2.1 (https://github.com/pallets/werkzeug/issues/2352) + assert response.headers["Location"] in ["http://localhost/my/uri", "/my/uri"] def test_header_not_returned(simple_openapi_app):