aboutsummaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorNavan Chauhan <navanchauhan@gmail.com>2021-06-04 15:45:09 +0530
committerNavan Chauhan <navanchauhan@gmail.com>2021-06-04 15:45:09 +0530
commitad3de666c83ac4b176258ee42804d0ef82e0e60b (patch)
tree46c9f674e75e693dad3873a7465da68c5bf0de29 /app
parenta672eb1f2bd95517b6beec378bed6dc7b6d93eb0 (diff)
added correct and incorrect form
Diffstat (limited to 'app')
-rw-r--r--app/tests/test_forms.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/app/tests/test_forms.py b/app/tests/test_forms.py
new file mode 100644
index 0000000..2da2c36
--- /dev/null
+++ b/app/tests/test_forms.py
@@ -0,0 +1,19 @@
+def test_incorrect_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_contactus(app,client):
+ res = client.post("/ContactUs",data={
+ "name": "Test User",
+ "subject": "Test Contact",
+ "email": "testemail@email.com",
+ "body": "Test Message"
+ }, follow_redirects=True)
+ assert res.status_code == 200
+ assert b"Wuhu" in res.data \ No newline at end of file