Skip to content
Snippets Groups Projects
Commit e1a6232b authored by Henrik tom Wörden's avatar Henrik tom Wörden
Browse files

Merge branch 'f-issue-166' into 'dev'

TST for server#166

See merge request !58
parents 9d8c9d0a 1e6d6d85
No related branches found
No related tags found
1 merge request!58TST for server#166
Pipeline #35181 passed
......@@ -1202,3 +1202,27 @@ def test_144():
assert isinstance(value, float)
assert value == 1e23
assert value == 1e+23
def test_166():
"""https://gitlab.com/caosdb/caosdb-server/-/issues/166"""
db.RecordType(name="exists").insert()
db.Property(name="exists_property", datatype=db.INTEGER).insert()
db.RecordType(name="RT1").add_parent("exists").insert()
db.RecordType(name="RT2").add_parent("exists").add_property("exists_property", 32453).insert()
with pytest.raises(TransactionError) as cm:
db.Record(name="RT3").add_parent("notexists").insert()
assert [e.msg for e in cm.value.errors] == ["Entity has unqualified parents."]
with pytest.raises(TransactionError) as cm:
db.Record(name="RT4").add_parent("exists").add_property("notexists", 234243).insert()
assert [e.msg for e in cm.value.errors] == ["Entity has unqualified properties."]
with pytest.raises(TransactionError) as cm:
db.Record(
name="RT5").add_parent("notexists").add_property(
"exists_property",
234243).insert()
assert [e.msg for e in cm.value.errors] == ["Entity has unqualified parents."]
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