26 lines
621 B
Python
26 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
|
||
|
|