Abri deal abandonment requires at least three parseable attempts 🟥

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Daniel Roth 2026-07-03 10:07:38 +00:00
parent 79423f594c
commit af85e0ed2b

View file

@ -928,6 +928,44 @@ def test_abri_deal_abandonment__non_abri_deal__returns_false() -> None:
assert result is False
@pytest.mark.parametrize(
"new_overrides",
[
{"number_of_attempts": "2"},
{"number_of_attempts": ""},
{"number_of_attempts": "not-a-number"},
{},
],
)
def test_abri_deal_abandonment__fewer_than_three_parseable_attempts__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",
outcome=None,
)
new_deal = make_new_deal(
deal_id,
project_code="Abri Condition",
outcome="No Answer",
**new_overrides,
)
# Act
result = HubspotDealDiffer.check_for_abri_deal_abandonment(
new_deal=new_deal,
new_project=None,
old_deal=old_deal,
)
# Assert
assert result is False
# =======================
# DB UPDATE TRIGGER TESTS
# =======================