From 09284e6fa89bab4c78991bc9c1b0fca459155e06 Mon Sep 17 00:00:00 2001
From: Alex <akreft@trineo.org>
Date: Tue, 13 Jul 2021 11:40:44 +0200
Subject: [PATCH] fix

---
 unittests/test_apiutils.py | 15 +++++----------
 1 file changed, 5 insertions(+), 10 deletions(-)

diff --git a/unittests/test_apiutils.py b/unittests/test_apiutils.py
index 5fcc27df..22e9da17 100644
--- a/unittests/test_apiutils.py
+++ b/unittests/test_apiutils.py
@@ -70,17 +70,12 @@ def test_id_query():
     assert create_id_query(ids) == 'FIND ENTITY WITH ID=1 OR ID=2 OR ID=3 OR ID=4 OR ID=5'
 
 
-original_retrieve_entity_with_id = caosdb.apiutils.retrieve_entity_with_id
-
-
-def dummy_entity(eid):
-    return db.Record(id=eid)
-
-
-caosdb.apiutils.retrieve_entity_with_id = dummy_entity
-
-
 def test_resolve_reference():
+    original_retrieve_entity_with_id = caosdb.apiutils.retrieve_entity_with_id
+
+    def dummy_entity(eid):
+        return db.Record(id=eid)
+    caosdb.apiutils.retrieve_entity_with_id = dummy_entity
     prop = db.Property(id=1, datatype=db.REFERENCE, value=100)
     prop.is_valid = lambda: True
     items = [200, 300, 400]
-- 
GitLab