diff options
author | Navan Chauhan <navanchauhan@gmail.com> | 2021-06-07 13:52:20 +0530 |
---|---|---|
committer | Navan Chauhan <navanchauhan@gmail.com> | 2021-06-07 13:52:20 +0530 |
commit | 359813517e3382c527125fe673fa89f0fd0742c0 (patch) | |
tree | 5010e2427cf0d19e7365e44fac40612375c135c9 /app/tests/test_views.py | |
parent | b752efffe410c9cc9cd53f8c50a5fb9f75069e93 (diff) |
added docstrings
Diffstat (limited to 'app/tests/test_views.py')
-rw-r--r-- | app/tests/test_views.py | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/app/tests/test_views.py b/app/tests/test_views.py index 811815f..f3df60d 100644 --- a/app/tests/test_views.py +++ b/app/tests/test_views.py @@ -1,7 +1,14 @@ +# -*- coding: utf-8 -*- +""" +Test(s) for Flask Views +""" from itsdangerous.url_safe import URLSafeSerializer from app import app as flask_app ts = URLSafeSerializer(flask_app.config["SECRET_KEY"]) +""" +To create confirmation tokens +""" data2check_visitors = { "/index": {"code": 200, "data": b"Nice Tagline"}, @@ -20,9 +27,15 @@ data2check_visitors = { "/confirm": {"code": 200, "data": b"Token not provided in URL Parameter"}, "/confirm?confirmation_token=123": {"code": 200, "data": b"Bad Token Provided"}, } +""" +Dictionary of Path, Expected Status Code and Data to Test for Visitors +""" def test_visitors(app, client): + """ + Test if Vistors get expected endpoints and status codes + """ for page in data2check_visitors: res = client.get(page) print("Testing %s", page) @@ -31,6 +44,11 @@ def test_visitors(app, client): def test_user_auth_flow(app, client): + """ + Test User Authentication Flow + + Tests Registeration, Email-Confirmation and Log-in along with appropriate redirects. + """ res = client.post( "/signup", data=dict( |