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

up

parent fc5977f6
Branches
Tags
No related merge requests found
...@@ -25,9 +25,9 @@ import caosdb as db ...@@ -25,9 +25,9 @@ import caosdb as db
def setup(): def setup():
rt = db.RecordType("Test") rt = db.RecordType("TestRec")
rt.insert() rt.insert()
p = db.Property("te", datatype=db.TEXT) p = db.Property("testProp", datatype=db.TEXT)
p.insert() p.insert()
...@@ -36,23 +36,19 @@ def teardown(): ...@@ -36,23 +36,19 @@ def teardown():
db.execute_query("FIND Test*").delete() db.execute_query("FIND Test*").delete()
except Exception as e: except Exception as e:
print(e) print(e)
try:
db.execute_query("FIND te").delete()
except Exception as e:
print(e)
@with_setup(setup, teardown) @with_setup(setup, teardown)
def test_deletion(): def test_deletion():
r = db.Record() r = db.Record()
r.add_parent("Test") r.add_parent("TestRec")
r.add_property("te", value="leer") r.add_property("testProp", value="leer")
r.insert() r.insert()
assert_equals(db.execute_query("FIND Test with te='leer'")[0].id, r.id) assert_equals(db.execute_query("FIND Test with te='leer'")[0].id, r.id)
r.delete() r.delete()
r = db.Record() r = db.Record()
r.add_parent("Test") r.add_parent("TestRec")
r.add_property("te", value="") r.add_property("testProp", value="")
r.insert() r.insert()
assert_equals(db.execute_query("FIND Test with te=''")[0].id, r.id) assert_equals(db.execute_query("FIND Test with te=''")[0].id, r.id)
r.delete() r.delete()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment