Skip to content
Myr

test_regression.py

This file

Path

tests/test_regression.py

30 lines · 712 bytes · Python

Last changed by

Not known.

History of this file

Take it

The walk stopped after 200 commits: lines older than 93a7f08 point at it.

pin os and python version in rtd buildDavid Lordbefore adoption93a7f08

lines 1–21why, one step back
1import flask
234def test_aborting(app):5 class Foo(Exception):6 whatever = 4278 @app.errorhandler(Foo)9 def handle_foo(e):10 return str(e.whatever)1112 @app.route("/")13 def index():14 raise flask.abort(flask.redirect(flask.url_for("test")))1516 @app.route("/test")17 def test():18 raise Foo()1920 with app.test_client() as c:21 rv = c.get("/")

Merge pull request #4496 from pallets/werkzeug-relative-redirectDavid Lordbefore adoption425a626

lines 22–28why, one step back
22 location_parts = rv.headers["Location"].rpartition("/")
2324 if location_parts[0]:25 # For older Werkzeug that used absolute redirects.26 assert location_parts[0] == "http://localhost"2728 assert location_parts[2] == "test"

pin os and python version in rtd buildDavid Lordbefore adoption93a7f08

lines 29–30why, one step back
29 rv = c.get("/test")
30 assert rv.data == b"42"