From b479d64daacbe3cac70e13cf3224276dc5654826 Mon Sep 17 00:00:00 2001 From: florian <f.spreckelsen@inidscale.com> Date: Tue, 8 Nov 2022 16:40:41 +0100 Subject: [PATCH] TST: Extend unittest for empty diff by id --- unittests/test_apiutils.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/unittests/test_apiutils.py b/unittests/test_apiutils.py index 7b22d995..f9de6d1a 100644 --- a/unittests/test_apiutils.py +++ b/unittests/test_apiutils.py @@ -466,6 +466,15 @@ def test_empty_diff(): assert not empty_diff(rec_a, rec_b) assert empty_diff(rec_a, rec_b, compare_referenced_records=True) + # special case of ids + rec_a = db.Record(id=12) + rec_b = db.Record() + assert not empty_diff(rec_a, rec_b) + rec_b.id = 13 + assert not empty_diff(rec_a, rec_b) + rec_b.id = 12 + assert empty_diff(rec_a, rec_b) + def test_force_merge(): """Test whether a forced merge overwrites existing properties correctly.""" -- GitLab