Skip to content
Snippets Groups Projects
Verified Commit f869471e authored by Daniel Hornung's avatar Daniel Hornung
Browse files

TEST: Short test for #156

parent 10f29f96
No related branches found
No related tags found
No related merge requests found
Pipeline #39839 passed
......@@ -37,3 +37,30 @@ def test_issue_100():
with raises(TypeError) as exc_info:
db.common.models._parse_single_xml_element(xml_el)
assert "Invalid datatype: List valued properties" in str(exc_info.value)
def test_issue_156():
"""Does parse_value make a mistake with entities?
https://gitlab.indiscale.com/caosdb/src/caosdb-pylib/-/issues/156
"""
project = db.Record(name="foo")
project.add_parent(name="RTName")
# <Record name="foo">
# <Parent name="RTName"/>
# </Record>
experiment = db.Record()
experiment.add_property(name="RTName", value=project)
# <Record>
# <Property name="RTName" importance="FIX" flag="inheritance:FIX">foo</Property>
# </Record>
value = experiment.get_property("RTName").value
# <Record name="foo">
# <Parent name="RTName"/>
# </Record>
parents = value.get_parents()
# <ParentList>
# <Parent name="RTName"/>
# </ParentList>
assert value is project
assert parents[0].name == "RTName"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment