aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app/tests/test_admin.py14
-rw-r--r--app/tests/test_views.py3
2 files changed, 17 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
diff --git a/app/tests/test_views.py b/app/tests/test_views.py
index 141c40d..da0d94b 100644
--- a/app/tests/test_views.py
+++ b/app/tests/test_views.py
@@ -25,6 +25,9 @@ data2check_visitors = {
},
"/Simulate500":{
"code":500,"data":b"Server Could Not Process This."
+ },
+ "/admin/user/":{
+ "code":403,"data":b"Forbidden"
}
}