update tests for relative redirects

This commit is contained in:
David Lord 2022-03-25 11:48:26 -07:00
parent ce7b884b73
commit 81c7ff7f8d
No known key found for this signature in database
GPG key ID: 7A1C87E3F5BC42A8
6 changed files with 20 additions and 9 deletions

View file

@ -19,6 +19,12 @@ def test_aborting(app):
with app.test_client() as c:
rv = c.get("/")
assert rv.headers["Location"] == "http://localhost/test"
location_parts = rv.headers["Location"].rpartition("/")
if location_parts[0]:
# For older Werkzeug that used absolute redirects.
assert location_parts[0] == "http://localhost"
assert location_parts[2] == "test"
rv = c.get("/test")
assert rv.data == b"42"