diff options
author | Navan Chauhan <navanchauhan@gmail.com> | 2021-06-04 15:31:38 +0530 |
---|---|---|
committer | Navan Chauhan <navanchauhan@gmail.com> | 2021-06-04 15:31:38 +0530 |
commit | 5f592793be63dfdb63f8602d6426fe8ea0d66f88 (patch) | |
tree | e7738df695b8d589b6156ca56a41dd1987baec0a | |
parent | 6910339f45a01a2840f06815efaa542494165a86 (diff) |
add incorrect form tests
-rw-r--r-- | app/tests/test_views.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/app/tests/test_views.py b/app/tests/test_views.py index 5f6d938..53c5d28 100644 --- a/app/tests/test_views.py +++ b/app/tests/test_views.py @@ -22,6 +22,9 @@ data2check_visitors = { }, "/signin":{ "code":200,"data":b"Sign in to your account." + }, + "/Simulate500":{ + "code":500,"data":b"Server Could Not Process This." } } @@ -32,6 +35,16 @@ def test_visitors(app, client): assert res.status_code == data2check_visitors[page]["code"] assert data2check_visitors[page]["data"] in res.data +def test_forms(app,client): + res = client.post("/signin",data={"email":"123"}) + assert b"This field is required." in res.data + + res = client.post("/signup",data={"email":"123"}) + assert b"This field is required." in res.data + + res = client.post("/ContactUs",data={"email":123}) + assert b"This field is required." in res.data + def test_user_auth_flow(app, client): res = client.post("/signup",data=dict( email="test@example.com", |