diff --git a/test/test_transaction.cpp b/test/test_transaction.cpp index 8ea3c1a4cecbab05f9c99393ba1566b5160b7ced..88df3a6ba6db6127e10aff3f301c1efecd066492 100644 --- a/test/test_transaction.cpp +++ b/test/test_transaction.cpp @@ -41,7 +41,18 @@ protected: void SetUp() override {} void TearDown() override { - // TODO(tf): delete all created entities + const auto &connection = + caosdb::connection::ConnectionManager::GetDefaultConnection(); + auto query_transaction(connection->CreateTransaction()); + query_transaction->Query("FIND ENTITY WITH id > 99"); + query_transaction->Execute(); + if (query_transaction->GetResultSet().Size() > 0) { + for (const Entity &entity : query_transaction->GetResultSet()) { + auto delete_transaction(connection->CreateTransaction()); + delete_transaction->DeleteById(entity.GetId()); + delete_transaction->Execute(); + } + } } };