fix wekan delete

This commit is contained in:
Philipp Rothmann 2022-04-29 16:32:10 +02:00
parent 5b85957012
commit 3034bb3b69
4 changed files with 8 additions and 9 deletions

View file

@ -19,7 +19,7 @@ run:
test:
./env/bin/pytest app
./env/bin/pytest --sw app
integration:
./env/bin/uvicorn app.main:app --reload --host 0.0.0.0

View file

@ -73,8 +73,8 @@ class WekanApi:
return self.get_user(r["_id"])
raise Exception()
def delete_user(self, user: str):
r = self.delete(f"users/{user}").json()
def delete_user(self, id: str):
r = self.delete(f"users/{id}").json()
print(r)
if "error" in r:
raise Exception(r)

View file

@ -26,12 +26,11 @@ def test_get_users(api: WekanApi):
assert True if "api" in [u.username for u in api.get_all_users()] else False
def test_create_user(api: WekanApi):
user = api.create_user("foo", "foo@bar.com", "")
user = api.create_user("foo", "foo@32bar.com", "")
assert api.get_user("foo").username == "foo"
assert type(user) is User
def test_delete_user(api: WekanApi):
api.create_user("foo", "foo@bar.com", "")
api.delete_user("foo") # TODO: doesn't work?
pytest.skip("smth wrong with wekan api")
assert api.get_user("foo") == None
u = api.create_user("Bar", "foo@bar42.com", "")
api.delete_user(u.id)
assert api.get_user("Bar") == None

View file

@ -62,7 +62,7 @@ def test_create_user(mocker, authentik: Authentik, authentik_user: WekanUser, we
assert wu.username == authentik_user.username
assert authentik_user.email in [i.address for i in wu.emails]
wekan.delete_user(authentik_user.username) # TODO WTF THIS NOT WORK?
wekan.delete_user(authentik_user.username)
@pytest.mark.skip()