From e272d2a0ba5bb02c3f7c17d08c368a3736df182a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Victor=20L=C3=B6fgren?= <viclo211@student.liu.se>
Date: Tue, 8 Jun 2021 17:53:28 +0200
Subject: [PATCH] Fix tests

---
 server/tests/test_app.py | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/server/tests/test_app.py b/server/tests/test_app.py
index 99ea9470..5263f8e3 100644
--- a/server/tests/test_app.py
+++ b/server/tests/test_app.py
@@ -63,21 +63,22 @@ def test_misc_api(client):
     ## Cities
     response, body = post(client, "/api/misc/cities", {"name": "Göteborg"}, headers=headers)
     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
     response, body = put(client, "/api/misc/cities/3", {"name": "Gbg"}, headers=headers)
     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
     # First checks current cities
     response, body = get(client, "/api/misc/cities", headers=headers)
     assert response.status_code == http_codes.OK
     assert len(body) >= 3
-    assert body[0]["name"] == "Linköping"
-    assert body[1]["name"] == "Testköping"
-    assert body[2]["name"] == "Gbg"
+    assert body[0]["name"] == "Gbg"
+    assert body[1]["name"] == "Linköping"
+    assert body[2]["name"] == "Testköping"
 
     # Deletes city
     response, body = delete(client, "/api/misc/cities/3", headers=headers)
-- 
GitLab