From 5894388a54450993fb1ce16d845f820f21090e32 Mon Sep 17 00:00:00 2001 From: Benjamin Bertrand <benjamin.bertrand@esss.se> Date: Tue, 17 Sep 2019 17:11:46 +0200 Subject: [PATCH] Fix tests after update to elasticsearch 7 --- tests/functional/test_models.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/functional/test_models.py b/tests/functional/test_models.py index 3965213..73d445b 100644 --- a/tests/functional/test_models.py +++ b/tests/functional/test_models.py @@ -561,7 +561,7 @@ def test_update_task_reverse_dependencies(user, task_factory): def test_host_indexed(db, host_factory): host1 = host_factory(name="myhost") res = db.app.elasticsearch.search(index="host-test", q="*") - assert res["hits"]["total"] == 1 + assert res["hits"]["total"]["value"] == 1 assert res["hits"]["hits"][0]["_id"] == str(host1.id) assert res["hits"]["hits"][0]["_id"] == str(host1.id) @@ -572,7 +572,7 @@ def test_host_with_interfaces_indexed(db, host_factory, interface_factory): interface_factory(name="myhost2", host=host1) for name in ("myhost", "myhost2"): res = db.app.elasticsearch.search(index="host-test", q=name) - assert res["hits"]["total"] == 1 + assert res["hits"]["total"]["value"] == 1 assert res["hits"]["hits"][0]["_id"] == str(host1.id) -- GitLab