aboutsummaryrefslogtreecommitdiff
path: root/app/tests
diff options
context:
space:
mode:
authorNavan Chauhan <navanchauhan@gmail.com>2021-06-06 15:06:02 +0530
committerNavan Chauhan <navanchauhan@gmail.com>2021-06-06 15:06:02 +0530
commit2c2e1772b23bbd42b99eeedc854f4d7b723e59d1 (patch)
tree54cfcb60686642c3cc8f9694e7965d416f107334 /app/tests
parent47b68d56d831d234c44da9530373b95dae338ea4 (diff)
add exceptions for confirm token and test for unverified email
Diffstat (limited to 'app/tests')
-rw-r--r--app/tests/test_views.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/app/tests/test_views.py b/app/tests/test_views.py
index a9645b2..0abd5e4 100644
--- a/app/tests/test_views.py
+++ b/app/tests/test_views.py
@@ -32,6 +32,12 @@ data2check_visitors = {
},
"/admin/user/":{
"code":403,"data":b"Forbidden"
+ },
+ "/confirm":{
+ "code":200,"data":b"Token not provided in URL Parameter"
+ },
+ "/confirm?confirmation_token=123":{
+ "code":200,"data":b"Bad Token Provided"
}
}
@@ -52,6 +58,13 @@ def test_user_auth_flow(app, client):
assert res.status_code == 200
assert b"confirm your email" in res.data
+ res = client.post("/signin",data=dict(
+ email="test@example.com",
+ password="testpassword"),
+ follow_redirects=True)
+ assert res.status_code == 200
+ assert b"Please Confirm Your Email First." in res.data
+
confirmation_token = ts.dumps("test@example.com",salt="email-confirm-key")
res = client.get("/confirm?confirmation_token={}".format(confirmation_token),
follow_redirects=True)