test_admin_api.test_users: properly delete test users

This commit is contained in:
Luna 2019-05-10 17:27:54 -03:00
parent 2c7c313a53
commit 23c7ac2c34
1 changed files with 6 additions and 2 deletions

View File

@ -84,8 +84,12 @@ async def _del_user(test_cli, user_id, *, token=None):
assert rjson['new']['id'] == user_id assert rjson['new']['id'] == user_id
assert rjson['old']['id'] == rjson['new']['id'] assert rjson['old']['id'] == rjson['new']['id']
# TODO: remove from database at this point? it'll just keep being # delete the original record since the DELETE endpoint will just
# filled up every time we run a test.. # replace the user by a "Deleted User <random hex>", and we don't want
# to have obsolete users filling up our db every time we run tests
await test_cli.app.db.execute("""
DELETE FROM users WHERE id = $1
""", int(user_id))
@pytest.mark.asyncio @pytest.mark.asyncio