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

Fix tests

parent e798f045
No related branches found
No related tags found
No related merge requests found
Pipeline #48950 canceled
...@@ -63,21 +63,22 @@ def test_misc_api(client): ...@@ -63,21 +63,22 @@ def test_misc_api(client):
## Cities ## Cities
response, body = post(client, "/api/misc/cities", {"name": "Göteborg"}, headers=headers) response, body = post(client, "/api/misc/cities", {"name": "Göteborg"}, headers=headers)
assert response.status_code == http_codes.OK assert response.status_code == http_codes.OK
assert len(body) >= 2 and body[2]["name"] == "Göteborg" assert len(body) >= 2 and body[0]["name"] == "Göteborg"
# Rename city # Rename city
response, body = put(client, "/api/misc/cities/3", {"name": "Gbg"}, headers=headers) response, body = put(client, "/api/misc/cities/3", {"name": "Gbg"}, headers=headers)
assert response.status_code == http_codes.OK assert response.status_code == http_codes.OK
assert len(body) >= 2 and body[2]["name"] == "Gbg"
assert len(body) >= 2 and body[0]["name"] == "Gbg"
# Delete city # Delete city
# First checks current cities # First checks current cities
response, body = get(client, "/api/misc/cities", headers=headers) response, body = get(client, "/api/misc/cities", headers=headers)
assert response.status_code == http_codes.OK assert response.status_code == http_codes.OK
assert len(body) >= 3 assert len(body) >= 3
assert body[0]["name"] == "Linköping" assert body[0]["name"] == "Gbg"
assert body[1]["name"] == "Testköping" assert body[1]["name"] == "Linköping"
assert body[2]["name"] == "Gbg" assert body[2]["name"] == "Testköping"
# Deletes city # Deletes city
response, body = delete(client, "/api/misc/cities/3", headers=headers) response, body = delete(client, "/api/misc/cities/3", headers=headers)
......
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