aboutsummaryrefslogtreecommitdiff
path: root/app/tests/test_admin.py
blob: 1a5df07add6f842c7e9c40137e2f278c8887b7a7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
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