Skip to content
Myr

Added a testcase for 404 errors caused by the routing system

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Armin Ronacher · committed by Armin Ronacher · parent eba2f70 · Browse files · 1 file+12 added−0 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+12 added−0 removed

  • tests:+12 added−0 removed

1 file+12 added−0 removed

modified:tests/flask_tests.py+12 added
562 unmodified lines
563 rv = c.get('/error')564 assert rv.status_code == 500565 assert 'internal server error' == rv.data566567 def test_before_request_and_routing_errors(self):568 app = flask.Flask(__name__)569 @app.before_request570 def attach_something():571 flask.g.something = 'value'572 @app.errorhandler(404)573 def return_something(error):574 return flask.g.something, 404575 rv = app.test_client().get('/')576 assert rv.status_code == 404577 assert rv.data == 'value'578579 def test_user_error_handling(self):580 class MyException(Exception):581 pass582
1403 unmodified lines