integrate/app/authentik/test_authentik.py
Philipp Rothmann 00de186ad4 authentik api
2022-03-04 18:51:51 +01:00

25 lines
621 B
Python

import email
from app.authentik.models import User
from .authentik import Authentik
def test_connection():
a = Authentik(base="http://localhost:9000/", token="foobar123", )
# res = a.create_web_hook(hook_endpoint="http://172.17.0.1:8000")
u = User(username="banane",
name="banane",
groups=[],
email="foo@example.org",
is_active=True,
attributes={}
)
if(a.get_user(u)):
print("delete")
a.delete(u)
assert False
c = a.create_user(u)
assert u.username == c.username
assert not c.pk == None