From 60e6ea57b12daa9c5d03a6fe5a2792f2345e51a6 Mon Sep 17 00:00:00 2001 From: Alan Orth Date: Mon, 2 Mar 2020 11:10:41 +0200 Subject: [PATCH] tests/test_api.py: Use UUID DSpace 6+ uses a UUID for item identifiers instead of an integer so we need to adapt our tests accordingly. The Python UUID object must be cast to a string to use it elsewhere in the code. --- tests/test_api.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/test_api.py b/tests/test_api.py index c7efc65..06642b3 100644 --- a/tests/test_api.py +++ b/tests/test_api.py @@ -22,11 +22,11 @@ def test_get_docs(client): def test_get_item(client): """Test requesting a single item.""" - response = client.simulate_get("/item/17") + response = client.simulate_get("/item/c3910974-c3a5-4053-9dce-104aa7bb1621") response_doc = json.loads(response.text) assert isinstance(response_doc["downloads"], int) - assert isinstance(response_doc["id"], int) + assert isinstance(response_doc["id"], str) assert isinstance(response_doc["views"], int) assert response.status_code == 200 @@ -34,7 +34,7 @@ def test_get_item(client): def test_get_missing_item(client): """Test requesting a single non-existing item.""" - response = client.simulate_get("/item/1") + response = client.simulate_get("/item/c3910974-c3a5-4053-9dce-104aa7bb1620") assert response.status_code == 404