From 359813517e3382c527125fe673fa89f0fd0742c0 Mon Sep 17 00:00:00 2001 From: Navan Chauhan Date: Mon, 7 Jun 2021 13:52:20 +0530 Subject: added docstrings --- app/tests/test_views.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'app/tests/test_views.py') 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( -- cgit v1.2.3