From e8b9b2baf80b04b66546f3b340353da4bebdfaa3 Mon Sep 17 00:00:00 2001 From: Navan Chauhan Date: Fri, 4 Jun 2021 22:25:03 +0530 Subject: added tests for admin view --- app/tests/test_admin.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 app/tests/test_admin.py (limited to 'app/tests/test_admin.py') diff --git a/app/tests/test_admin.py b/app/tests/test_admin.py new file mode 100644 index 0000000..1a5df07 --- /dev/null +++ b/app/tests/test_admin.py @@ -0,0 +1,14 @@ +from app import database_cli + +def test_admin(app, client): + runner = app.test_cli_runner() + assert runner.invoke(database_cli,["admin-create"]).exit_code == 0 + + res = client.post("/signin",data=dict( + email=app.config["ADMIN_EMAIL"], + password=app.config["ADMIN_PASSWORD"]),follow_redirects=True) + + print(res.data) + assert b"Supersu" in res.data + res = client.get("/admin/user/") + assert res.status_code == 200 \ No newline at end of file -- cgit v1.2.3