aboutsummaryrefslogtreecommitdiff
path: root/app/tests/test_admin.py
diff options
context:
space:
mode:
authorNavan Chauhan <navanchauhan@gmail.com>2021-06-04 22:25:03 +0530
committerNavan Chauhan <navanchauhan@gmail.com>2021-06-04 22:25:03 +0530
commite8b9b2baf80b04b66546f3b340353da4bebdfaa3 (patch)
treeae6cb216172e2362504b6b3aab06259c74067ac5 /app/tests/test_admin.py
parent5b52deffd64c58f0d95f8e9d6e54b3353f7b599e (diff)
added tests for admin view
Diffstat (limited to 'app/tests/test_admin.py')
-rw-r--r--app/tests/test_admin.py14
1 files changed, 14 insertions, 0 deletions
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