diff --git a/tests/functional/test_models.py b/tests/functional/test_models.py
index 39652135b1174160face218be9247a5ebcab552f..73d445b77ce21cdc9fafc8b4a2bd26fc7fa5ec14 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)