Added the "/.errors" route to the application in the "create_test_app" function in testlib.py, to make it easier to test.

This commit is contained in:
依瑪貓 2023-03-18 02:59:28 +08:00
parent 56045f0faf
commit b9435a255b

View File

@ -40,6 +40,11 @@ def create_test_app() -> Flask:
"""The test view to return the CSRF token."""
return render_template_string("{{csrf_token()}}")
@app.get("/.errors")
def get_errors_view() -> str:
"""The test view to return the CSRF token."""
return render_template_string("{{get_flashed_messages()|tojson}}")
return app