diff --git a/unittests/test_tool.py b/unittests/test_tool.py
index 90d10cf73235dae5c955ebc46d84218429910dd2..ec3e0bb9e69a45416d23f3c7aba15ec759cabf77 100755
--- a/unittests/test_tool.py
+++ b/unittests/test_tool.py
@@ -589,8 +589,8 @@ def test_replace_entities_with_ids(crawler):
 
 
 def mock_get_entity_by(eid=None, name=None):
-    if id is not None:
-        candidates = [el for el in list(full_data.values()) if el.id == id]
+    if eid is not None:
+        candidates = [el for el in list(full_data.values()) if el.id == eid]
         if len(candidates) > 0:
             return candidates[0]
         else: