Skip to content
Snippets Groups Projects
Commit 31c5e197 authored by florian's avatar florian
Browse files

TST: Extend merge-bug test

parent 15ac87c5
No related branches found
No related tags found
2 merge requests!79Release 0.10.0,!72F fix merge entity conflicts
......@@ -393,6 +393,21 @@ def test_wrong_merge_conflict_reference():
assert rec_a.get_property(license_rt.name) is not None
assert rec_a.get_property(license_rt.name).value is not None
assert isinstance(rec_a.get_property(license_rt.name).value, db.Record)
assert rec_a.get_property(license_rt.name).value.name == license_rec_a.name
assert rec_a.get_property(license_rt.name).value.name == license_rec_b.name
assert rec_a.get_property("title").value == "Some dataset title"
assert rec_a.get_property("doi").value == "https://doi.org/12345.678"
# this does not compare referenced records, so it will fail
with pytest.raises(RuntimeError) as re:
merge_entities(rec_a, rec_b, merge_references_with_empty_diffs=False)
assert "Merge conflict" in str(re.value)
# ... as should this, of course
rec_b.get_property(license_rt.name).value.name = "Another license"
with pytest.raises(RuntimeError) as re:
merge_entities(rec_a, rec_b)
assert "Merge conflict" in str(re.value)
def test_empty_diff():
......
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