Skip to content
Snippets Groups Projects
Unverified Commit 8b0973ae authored by Daniel's avatar Daniel
Browse files

TEST: Removed xfail from test for caosdb-mysqlbackend #18

parent 33e071f4
No related branches found
No related tags found
No related merge requests found
......@@ -48,10 +48,9 @@ def teardown():
# ########################### Issue tests start here ###########################
@pytest.mark.xfail
@with_setup(setup, teardown)
def test_issue_18():
"""Sometimes, duplicate parents were returned.
"""Duplicate parents were returned in some cases of self-hineritance.
Tests for https://gitlab.com/caosdb/caosdb-mysqlbackend/-/issues/18
"""
......@@ -64,9 +63,9 @@ def test_issue_18():
C.add_parent(C) # The self-parenting is here on purpose
C.add_parent(A)
c = db.Container()
c.extend([B, C, A])
c.insert()
cont = db.Container()
cont.extend([B, C, A])
cont.insert()
C1 = db.Entity(name="C").retrieve()
pids = [p.id for p in C1.parents]
......
......@@ -49,7 +49,8 @@ def test_property_no_id():
rt1 = db.RecordType(name="RT1").insert()
rt1.add_property(name="P1").update(raise_exception_on_error=False)
assert rt1.get_property("P1").get_errors()[0].description == "Entity has no ID."
assert rt1.get_property("P1").get_errors()[0].description \
== "Entity has no ID."
def test_parent_no_id():
......@@ -57,7 +58,8 @@ def test_parent_no_id():
parent = db.RecordType(name="RTP").insert()
child.add_parent(name="RTP").update(raise_exception_on_error=False)
assert child.get_parent("RTP").get_errors()[0].description == "Entity has no ID."
assert child.get_parent("RTP").get_errors()[0].description \
== "Entity has no ID."
def test_update_1():
......@@ -104,7 +106,8 @@ def test_server_error_during_update():
p = db.Property(name="TestProperty", datatype="TestRT1").insert()
p2 = db.Property(name="TestBogusProperty", datatype=db.TEXT).insert()
rec1 = db.Record(name="TestRT1Rec1").add_parent("TestRT1").insert()
rec2 = db.Record(name="TestRT2Rec2").add_parent("TestRT2").add_property("TestProperty", "TestRT1Rec1").insert()
rec2 = db.Record(name="TestRT2Rec2").add_parent("TestRT2").add_property(
"TestProperty", "TestRT1Rec1").insert()
# do stupid things
rec2.get_property("TestProperty").add_property("TestBogusProperty")
......
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