Skip to content
Snippets Groups Projects
Commit c467fe68 authored by Victor Löfgren's avatar Victor Löfgren
Browse files

Fix test_competition_api test

parent ccf29469
No related branches found
No related tags found
1 merge request!161Resolve "replace-restx-with-smorest"
......@@ -112,7 +112,7 @@ def test_competition_api(client):
response, body = get(client, f"/api/competitions/{competition_id}/slides", headers=headers)
assert response.status_code == http_codes.OK
assert len(body["items"]) == 2
assert len(body) == 2
"""
response, body = put(client, f"/api/competitions/{competition_id}/slides/{2}/order", {"order": 1}, headers=headers)
......@@ -124,11 +124,11 @@ def test_competition_api(client):
response, body = get(client, f"/api/competitions/{competition_id}/teams", headers=headers)
assert response.status_code == http_codes.OK
assert len(body["items"]) == 1
assert body["items"][0]["name"] == "t1"
assert len(body) == 1
assert body[0]["name"] == "t1"
response, body = delete(client, f"/api/competitions/{competition_id}", headers=headers)
assert response.status_code == http_codes.OK
response, body = delete(client, f"/api/competitions/{competition_id}", headers=headqers)
assert response.status_code == http_codes.NO_CONTENT
# Get competition
competition_id = 2
......@@ -203,7 +203,7 @@ def test_auth_and_user_api(client):
assert body["count"] == 1
# Get user from ID
searched_user = body["items"][0]
searched_user = body[0]
user_id = searched_user["id"]
response, body = get(client, f"/api/users/{user_id}", headers=headers)
assert response.status_code == http_codes.OK
......@@ -339,8 +339,8 @@ def test_slide_api(client):
response, body = get(client, f"/api/competitions/{CID}/slides", headers=headers)
assert response.status_code == http_codes.OK
assert body["count"] == 3
assert body["items"][0]["id"] == 3
assert body["items"][0]["order"] == 0
assert body[0]["id"] == 3
assert body[0]["order"] == 0
slide_id = 3
"""
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment