From c059771af5fe13d508aabc85cdbf2d57a668c648 Mon Sep 17 00:00:00 2001 From: Daniel Roth Date: Thu, 2 Jul 2026 16:02:08 +0000 Subject: [PATCH] =?UTF-8?q?Abri=20survey=20creation=20trigger=20ignores=20?= =?UTF-8?q?syncs=20with=20no=20parseable=20confirmed=5Fsurvey=5Fdate=20?= =?UTF-8?q?=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 | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/etl/hubspot/tests/test_hubspot_deal_differ.py b/etl/hubspot/tests/test_hubspot_deal_differ.py index 7391706e9..a50634dea 100644 --- a/etl/hubspot/tests/test_hubspot_deal_differ.py +++ b/etl/hubspot/tests/test_hubspot_deal_differ.py @@ -448,6 +448,41 @@ def test_abri_survey_creation__project_code_cased_differently__returns_true() -> assert result is True +@pytest.mark.parametrize( + "new_overrides", + [ + {}, + {"confirmed_survey_date": ""}, + {"confirmed_survey_date": "not-a-date"}, + ], +) +def test_abri_survey_creation__no_parseable_new_date__returns_false( + new_overrides: Dict[str, str], +) -> None: + deal_id = uuid.uuid4() + + # Arrange + old_deal = make_old_deal( + id=deal_id, + project_code="Abri Condition", + confirmed_survey_date=None, + ) + new_deal = make_new_deal( + deal_id, + project_code="Abri Condition", + **new_overrides, + ) + + # Act + result = HubspotDealDiffer.check_for_abri_survey_creation( + new_deal=new_deal, + old_deal=old_deal, + ) + + # Assert + assert result is False + + # ======================= # DB UPDATE TRIGGER TESTS # =======================