Skip to content
Snippets Groups Projects
Verified Commit f080f121 authored by Timm Fitschen's avatar Timm Fitschen
Browse files

TST: add tests for caosdb-server#170

parent 06205692
No related branches found
No related tags found
1 merge request!12TST: add tests for caosdb-server#170
Pipeline #12838 passed with warnings
......@@ -257,3 +257,46 @@ def test_issue_131():
"FIND Entity WITH {} > 100.5 €".format(prop.name))]
assert rec.id in result_ids
def test_issue_170():
"""update scalar data type to list data type"""
p = db.Property(name="TestProp1", datatype=db.LIST(db.INTEGER))
p.value = [1,2]
p.insert() # works
p2 = db.execute_query("FIND TestProp1", unique=True)
assert p2.datatype == db.LIST(db.INTEGER)
assert p2.value == [1,2]
p.description = "TestDescription"
p.update() # fails
p2 = db.execute_query("FIND TestProp1", unique=True)
assert p2.datatype == db.LIST(db.INTEGER)
assert p2.value == [1,2]
assert p2.description == "TestDescription"
p = db.Property(name="TestProp2", datatype=db.DOUBLE)
p.insert() # works
p.datatype = db.LIST(db.INTEGER)
p.update() # works
p2 = db.execute_query("FIND TestProp1", unique=True)
assert p2.datatype == db.LIST(db.INTEGER)
assert p2.value == [1,2]
p2.value = [1, 2]
p2.update() # fails
p = db.Property(name="TestProp3", datatype=db.DOUBLE)
p.insert() # works
p.datatype = db.LIST(db.INTEGER)
p.value = [1, 2]
p.update() # fails
p2 = db.execute_query("FIND TestProp1", unique=True)
assert p2.datatype == db.LIST(db.INTEGER)
assert p2.value == [1,2]
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