Abri deal abandonment requires a negative outcome 🟥

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Daniel Roth 2026-07-03 10:10:26 +00:00
parent 88093eb7cd
commit 41d62ce2b2

View file

@ -966,6 +966,83 @@ def test_abri_deal_abandonment__fewer_than_three_parseable_attempts__returns_fal
assert result is False
@pytest.mark.parametrize(
"new_overrides",
[
{"outcome": "Surveyed"},
{"outcome": ""},
{},
],
)
def test_abri_deal_abandonment__outcome_not_negative__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",
number_of_attempts="3",
**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
@pytest.mark.parametrize(
"outcome",
[
"No Answer",
"Cancelled",
"No Show",
"Tenant Refusal",
"Not Viable",
"NO ANSWER",
],
)
def test_abri_deal_abandonment__each_negative_outcome__returns_true(
outcome: 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",
number_of_attempts="3",
outcome=outcome,
)
# Act
result = HubspotDealDiffer.check_for_abri_deal_abandonment(
new_deal=new_deal,
new_project=None,
old_deal=old_deal,
)
# Assert
assert result is True
# =======================
# DB UPDATE TRIGGER TESTS
# =======================