From 5f592793be63dfdb63f8602d6426fe8ea0d66f88 Mon Sep 17 00:00:00 2001 From: Navan Chauhan Date: Fri, 4 Jun 2021 15:31:38 +0530 Subject: add incorrect form tests --- app/tests/test_views.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) 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", -- cgit v1.2.3