From 91dc359e0d0351932b40f6f1c38b4cb1bb5f9328 Mon Sep 17 00:00:00 2001 From: Daniel Roth Date: Mon, 20 Jul 2026 08:36:50 +0000 Subject: [PATCH] =?UTF-8?q?A=20blank=20stored=20surveyor=20also=20counts?= =?UTF-8?q?=20as=20unset=20in=20the=20amendment=20check=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 --- etl/hubspot/tests/test_abri_flow_triggers.py | 26 ++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/etl/hubspot/tests/test_abri_flow_triggers.py b/etl/hubspot/tests/test_abri_flow_triggers.py index e85ef2f7b..1e0ecdf52 100644 --- a/etl/hubspot/tests/test_abri_flow_triggers.py +++ b/etl/hubspot/tests/test_abri_flow_triggers.py @@ -174,6 +174,32 @@ def test_a_blank_surveyor_on_a_booked_deal_with_no_stored_surveyor_is_not_a_chan assert message is None +def test_a_blank_stored_surveyor_and_a_missing_incoming_one_are_not_a_change() -> None: + # Arrange: booking exists; DB stored "" for the surveyor, HubSpot omits it. + old_deal = make_old_deal( + project_code=ABRI_PROJECT_CODE, + confirmed_survey_date=datetime(2026, 6, 24, tzinfo=timezone.utc), + confirmed_survey_time="14:30", + third_party_surveyor_identifier="", + ) + new_deal = make_new_deal( + confirmed_survey_date="2026-06-24", + confirmed_survey_time="14:30", + ) + + # Act + message = HubspotDealDiffer.check_abri_triggers_and_construct_message( + hubspot_deal_id=DEAL_ID, + new_deal=new_deal, + new_project=None, + new_listing=LISTING, + old_deal=old_deal, + ) + + # Assert + assert message is None + + def test_an_unchanged_surveyor_on_a_booked_deal_fires_nothing() -> None: # Arrange: booking exists; surveyor and appointment are unchanged. old_deal = make_old_deal(