fix wekan delete
This commit is contained in:
parent
5b85957012
commit
3034bb3b69
4 changed files with 8 additions and 9 deletions
2
Makefile
2
Makefile
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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()
|
||||
|
|
Loading…
Reference in a new issue