Skip to content

Commit

Permalink
Update tests for changed werkzeug behavior in 2.1 (#1506)
Browse files Browse the repository at this point in the history
  • Loading branch information
RobbeSneyders authored Apr 4, 2022
1 parent 0b509f2 commit ea45242
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tests/api/test_headers.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,17 @@ 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):
app_client = simple_app.app.test_client()

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):
Expand Down

0 comments on commit ea45242

Please sign in to comment.