Skip to content
Snippets Groups Projects
Verified Commit 5d6fa0ce authored by Timm Fitschen's avatar Timm Fitschen
Browse files
parent a58233f5
No related branches found
No related tags found
No related merge requests found
Pipeline #31018 passed
...@@ -429,6 +429,7 @@ def test_bug_parent_name_in_old_version(): ...@@ -429,6 +429,7 @@ def test_bug_parent_name_in_old_version():
assert [OLD_NAME] == [p.name for p in rec_v1.get_parents()] assert [OLD_NAME] == [p.name for p in rec_v1.get_parents()]
@mark.xfail(reason="fix https://gitlab.com/caosdb/caosdb-server/-/issues/178")
def test_reference_deleted_in_old_version(): def test_reference_deleted_in_old_version():
ref_rt = insertion("TestReferencedObject") ref_rt = insertion("TestReferencedObject")
rt = insertion("TestRT") rt = insertion("TestRT")
...@@ -491,14 +492,23 @@ def test_reference_deleted_in_old_version(): ...@@ -491,14 +492,23 @@ def test_reference_deleted_in_old_version():
assert test_rec.get_property(ref_rt) is None assert test_rec.get_property(ref_rt) is None
assert test_rec.version.predecessors[0].id == old_version assert test_rec.version.predecessors[0].id == old_version
# retrieve old version again. the reference (to the now deleted entity) # retrieve old version again (cache on). the reference (to the now deleted
# is still there. # entity) is still there.
old_rec = c.Container().retrieve(str(test_rec.id) + "@HEAD~1", old_rec = c.Container().retrieve(str(test_rec.id) + "@HEAD~1",
sync=False)[0] sync=False)[0]
assert old_rec.version.id == old_version assert old_rec.version.id == old_version
assert old_rec.version.successors[0].id == test_rec.version.id assert old_rec.version.successors[0].id == test_rec.version.id
assert old_rec.get_property(p).value == "blablabla" assert old_rec.get_property(p).value == "blablabla"
assert old_rec.get_property(ref_rt).value == referenced_id assert old_rec.get_property(ref_rt).value is None, "TODO this fails"
# retrieve old version again (cache off). the reference (to the now deleted
# entity) is NOT there
old_rec = c.Container().retrieve(str(test_rec.id) + "@HEAD~1",
sync=False, flags={"cache": "false"})[0]
assert old_rec.version.id == old_version
assert old_rec.version.successors[0].id == test_rec.version.id
assert old_rec.get_property(p).value == "blablabla"
assert old_rec.get_property(ref_rt).value is None
with raises(c.EmptyUniqueQueryError) as exc: with raises(c.EmptyUniqueQueryError) as exc:
c.execute_query("FIND ENTITY WITH ID = {}".format(referenced_id), c.execute_query("FIND ENTITY WITH ID = {}".format(referenced_id),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment