integrate/app/authentik/test_authentik.py

26 lines
621 B
Python
Raw Normal View History

2022-03-04 18:51:33 +01:00
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