From 1d3219ca600e4657f59d5e13fa57faf80b513179 Mon Sep 17 00:00:00 2001 From: Daniel Roth Date: Mon, 6 Jul 2026 13:27:39 +0000 Subject: [PATCH] =?UTF-8?q?Contact=20carries=20the=20best-priority=20mobil?= =?UTF-8?q?e=20and=20landline=20Abri=20lists=20=F0=9F=9F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Fable 5 --- .../test_tenant_data_sync_orchestrator.py | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/tests/orchestration/test_tenant_data_sync_orchestrator.py b/tests/orchestration/test_tenant_data_sync_orchestrator.py index 3ed1272aa..329f04a90 100644 --- a/tests/orchestration/test_tenant_data_sync_orchestrator.py +++ b/tests/orchestration/test_tenant_data_sync_orchestrator.py @@ -187,6 +187,38 @@ def test_run_creates_a_separate_contact_for_each_signatory( assert associated_contact_ids == ["60123", "60124"] +def test_run_picks_the_best_priority_number_of_each_kind_for_a_contact( + orchestrator: TenantDataSyncOrchestrator, + mock_session: MagicMock, + sdk_client: MagicMock, +) -> None: + # Arrange + mock_session.post.return_value.content = _tenancy_response( + '1368473' + "07000000099" # no priority: sorts last + ' ' # blank number: ignored + '07000000020' + '07000000005' # lowest priority: wins + '01000000001' # unusable: sorts last + '01000000007' # tie, first in document + '01000000008' + "" + ) + + # Act + orchestrator.run(PLACE_REF, deal_id=DEAL_ID) + + # Assert + created_properties = ( + sdk_client.crm.contacts.basic_api.create.call_args.kwargs[ + "simple_public_object_input_for_create" + ].properties + ) + assert created_properties["mobilephone"] == "07000000005" + assert created_properties["phone"] == "01000000007" + + def test_run_still_creates_a_contact_for_an_all_blank_signatory( orchestrator: TenantDataSyncOrchestrator, mock_session: MagicMock,