From bd830295ce163b0b64b772cf537fc71f6abce0e9 Mon Sep 17 00:00:00 2001
From: Florian Spreckelsen <f.spreckelsen@indiscale.com>
Date: Fri, 22 Nov 2024 16:38:36 +0100
Subject: [PATCH] TST: Extend to/from_xml consistency checks

---
 tests/test_issues_pylib.py | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/tests/test_issues_pylib.py b/tests/test_issues_pylib.py
index a816f14..49203bc 100644
--- a/tests/test_issues_pylib.py
+++ b/tests/test_issues_pylib.py
@@ -78,7 +78,8 @@ def test_gitlab_com_89():
     https://gitlab.indiscale.com/caosdb/customers/f-fit/management/-/issues/81
     """
     # We need a container generated with data from the server
-    db.RecordType(name="TestType").insert()
+    rt = db.RecordType(name="TestType")
+    rt.insert()
     container = db.execute_query("FIND RECORDTYPE *")
 
     # With this container, to_xml, xml2str, and from_xml should not generate
@@ -86,7 +87,9 @@ def test_gitlab_com_89():
     with warnings.catch_warnings():
         warnings.simplefilter("error")
         xml_str = linkahead.common.utils.xml2str(container.to_xml())
-        db.Container.from_xml(xml_str)
+        cont_from_xml = db.Container.from_xml(xml_str)
+        assert len(cont_from_xml) == len(container)
+        assert cont_from_xml[0].name == rt.name
 
 
 # @pytest.mark.xfail(reason="Entities with many, long, properties: "
-- 
GitLab