From 6bca4319289d2e8330d86b9241505bfd6678cd3f Mon Sep 17 00:00:00 2001
From: Alexander Kreft <akreft@trineo.org>
Date: Wed, 25 Aug 2021 14:19:45 +0000
Subject: [PATCH] TST: Add test update_entity

---
 test/runtests.jl | 17 ++++++++++++-----
 1 file changed, 12 insertions(+), 5 deletions(-)

diff --git a/test/runtests.jl b/test/runtests.jl
index e8c461b..774ea49 100644
--- a/test/runtests.jl
+++ b/test/runtests.jl
@@ -151,13 +151,20 @@ end
 
     @testset "Test entity update" begin
         
-        resset = execute_query("FIND TestEnt")
         ent_with_name = execute_query("FIND TestEnt")
-        prop = CaosDB.Entity.create_property(name = "TestProperty", value = "12345")
-        CaosDB.Entity.set_datatype(prop, "INTEGER")
-        CaosDB.Entity.append_properties(ent_with_name[1], [prop])
-
+        prop = CaosDB.Entity.create_property_entity(name = "TestProperty", datatype = "TEXT", unit = "cm", 
+            is_reference = false, is_list = false)
+        
+        single_insert_transaction1 = create_transaction()
+        add_insert_entity(single_insert_transaction1, prop)
+        execute(single_insert_transaction1)
+        results = get_results(single_insert_transaction1 )
+        
+        prop2 = CaosDB.Entity.create_property(id=get_id(results[1]))
+        CaosDB.Entity.append_property(ent_with_name[1], prop2)
+        
         single_insert_transaction = create_transaction()
+        
         add_update_entity(single_insert_transaction , ent_with_name[1])
         execute(single_insert_transaction)
         results = get_results(single_insert_transaction )
-- 
GitLab