document the lifecycle of a flask application and request

This commit is contained in:
David Lord 2023-02-10 14:48:02 -08:00
parent 129568f7f4
commit a6cd8f212e
No known key found for this signature in database
GPG key ID: 7A1C87E3F5BC42A8
3 changed files with 172 additions and 2 deletions

View file

@ -69,11 +69,12 @@ everything that runs in the block will have access to :data:`request`,
populated with your test data. ::
def generate_report(year):
format = request.args.get('format')
format = request.args.get("format")
...
with app.test_request_context(
'/make_report/2017', data={'format': 'short'}):
"/make_report/2017", query_string={"format": "short"}
):
generate_report()
If you see that error somewhere else in your code not related to