Skip to content
Snippets Groups Projects
Commit e5e5ec8a authored by Joffjoff5000's avatar Joffjoff5000
Browse files

Add get user from id to test

parent 199a4f7e
No related branches found
No related tags found
1 merge request!55Resolve "Add more api calls"
...@@ -134,8 +134,19 @@ def test_auth_and_users_api(client): ...@@ -134,8 +134,19 @@ def test_auth_and_users_api(client):
assert response.status_code == codes.OK assert response.status_code == codes.OK
assert body["count"] == 1 assert body["count"] == 1
# Get user from ID
searched_user = body["items"][0]
user_id = searched_user["id"]
response, body = get(client, f"/api/users/{user_id}", headers=headers)
print("searched_user: ", searched_user)
print("curr_user:", body)
assert searched_user["name"] == body["name"]
assert searched_user["email"] == body["email"]
assert searched_user["role_id"] == body["role"]["id"]
assert searched_user["city_id"] == body["city"]["id"]
assert searched_user["id"] == body["id"]
# Delete other user # Delete other user
user_id = body["items"][0]["id"]
response, body = delete(client, f"/api/auth/delete/{user_id}", headers=headers) response, body = delete(client, f"/api/auth/delete/{user_id}", headers=headers)
assert response.status_code == codes.OK assert response.status_code == codes.OK
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment