From b9e24fd5d3c92f68145797d283f96810d498a989 Mon Sep 17 00:00:00 2001 From: Michael Harbarth Date: Wed, 29 Nov 2023 14:06:51 +0100 Subject: [PATCH] test: update test_patch_work_item_grouped_links test --- tests/test_elements.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/test_elements.py b/tests/test_elements.py index e27fc770..5d969dec 100644 --- a/tests/test_elements.py +++ b/tests/test_elements.py @@ -517,10 +517,14 @@ def test_patch_work_item_grouped_links( obj.uuid ].linked_work_items + def mock_back_link(work_item, back_links): + back_links[work_item.id] = [] + mock_grouped_links = mock.MagicMock() monkeypatch.setattr( element, "create_grouped_link_fields", mock_grouped_links ) + mock_grouped_links.side_effect = mock_back_link mock_grouped_links_reverse = mock.MagicMock() monkeypatch.setattr( @@ -542,6 +546,7 @@ def test_patch_work_item_grouped_links( mock_grouped_links_calls = mock_grouped_links.call_args_list assert len(mock_grouped_links_calls) == 3 + assert mock_grouped_links_reverse.call_count == 3 assert mock_grouped_links_calls[0][0][0] == dummy_work_items["uuid0"] assert mock_grouped_links_calls[1][0][0] == dummy_work_items["uuid1"]