Redirect to login page when CSRF error occurs
This commit is contained in:
14
tests/routes/test_errors.py
Normal file
14
tests/routes/test_errors.py
Normal file
@@ -0,0 +1,14 @@
|
||||
|
||||
def test_csrf_error(app, client):
|
||||
app.config.update({"WTF_CSRF_ENABLED": True})
|
||||
|
||||
response = client.post(
|
||||
"/requests/new/1",
|
||||
headers={ "Content-Type": "application/x-www-form-urlencoded" },
|
||||
data="csrf_token=invalid_token",
|
||||
follow_redirects=True,
|
||||
)
|
||||
|
||||
body = response.data.decode()
|
||||
assert "Session Expired" in body
|
||||
assert "Log in Required" in body
|
Reference in New Issue
Block a user