From 8c5d1a27fff2a7212efc47cce16663fb7c920ae1 Mon Sep 17 00:00:00 2001 From: Daniel Roth Date: Thu, 2 Jul 2026 16:50:53 +0000 Subject: [PATCH] =?UTF-8?q?Abri=20survey=20amendment=20trigger=20fires=20w?= =?UTF-8?q?hen=20the=20confirmed=20survey=20time=20changes=20on=20an=20Abr?= =?UTF-8?q?i=20condition=20deal=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_hubspot_deal_differ.py | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/etl/hubspot/tests/test_hubspot_deal_differ.py b/etl/hubspot/tests/test_hubspot_deal_differ.py index 9c581da89..2cdc0cd5c 100644 --- a/etl/hubspot/tests/test_hubspot_deal_differ.py +++ b/etl/hubspot/tests/test_hubspot_deal_differ.py @@ -633,6 +633,34 @@ def test_abri_survey_amendment__date_and_time_unchanged__returns_false() -> None assert result is False +def test_abri_survey_amendment__time_changed_on_abri_deal__returns_true() -> None: + deal_id = uuid.uuid4() + + # Arrange + old_deal = make_old_deal( + id=deal_id, + project_code="Abri Condition", + confirmed_survey_date=datetime(2026, 7, 15, tzinfo=timezone.utc), + confirmed_survey_time="09:30", + ) + new_deal = make_new_deal( + deal_id, + project_code="Abri Condition", + confirmed_survey_date="2026-07-15", + confirmed_survey_time="14:00", + ) + + # Act + result = HubspotDealDiffer.check_for_abri_survey_amendment( + new_deal=new_deal, + new_project=None, + old_deal=old_deal, + ) + + # Assert + assert result is True + + # ======================= # DB UPDATE TRIGGER TESTS # =======================