mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-07-12 13:29:04 +00:00
Abri tenant data fetch resolves abri deals by associated project id 🟩
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
parent
5df1237b90
commit
a36fe00132
1 changed files with 59 additions and 0 deletions
|
|
@ -808,6 +808,65 @@ def test_abri_tenant_data_fetch__no_parseable_new_commencement_date__returns_fal
|
|||
assert result is False
|
||||
|
||||
|
||||
def test_abri_tenant_data_fetch__associated_abri_project_id__returns_true() -> None:
|
||||
deal_id = uuid.uuid4()
|
||||
|
||||
# Arrange
|
||||
old_deal = make_old_deal(
|
||||
id=deal_id,
|
||||
project_code="Southern Retrofit",
|
||||
expected_commencement_date=None,
|
||||
)
|
||||
new_deal = make_new_deal(
|
||||
deal_id,
|
||||
project_code="Southern Retrofit",
|
||||
expected_commencement_date="2026-08-01",
|
||||
)
|
||||
new_project = ProjectData(
|
||||
project_id=HubspotDealDiffer.ABRI_CONDITION_ASSOCIATED_PROJECT_ID,
|
||||
name="Abri Condition",
|
||||
)
|
||||
|
||||
# Act
|
||||
result = HubspotDealDiffer.check_for_abri_tenant_data_fetch(
|
||||
new_deal=new_deal,
|
||||
new_project=new_project,
|
||||
old_deal=old_deal,
|
||||
)
|
||||
|
||||
# Assert
|
||||
assert result is True
|
||||
|
||||
|
||||
def test_abri_tenant_data_fetch__non_abri_project_id_with_abri_code__returns_false() -> (
|
||||
None
|
||||
):
|
||||
deal_id = uuid.uuid4()
|
||||
|
||||
# Arrange
|
||||
old_deal = make_old_deal(
|
||||
id=deal_id,
|
||||
project_code="Abri Condition",
|
||||
expected_commencement_date=None,
|
||||
)
|
||||
new_deal = make_new_deal(
|
||||
deal_id,
|
||||
project_code="Abri Condition",
|
||||
expected_commencement_date="2026-08-01",
|
||||
)
|
||||
new_project = ProjectData(project_id="999999", name="Southern Retrofit")
|
||||
|
||||
# Act
|
||||
result = HubspotDealDiffer.check_for_abri_tenant_data_fetch(
|
||||
new_deal=new_deal,
|
||||
new_project=new_project,
|
||||
old_deal=old_deal,
|
||||
)
|
||||
|
||||
# Assert
|
||||
assert result is False
|
||||
|
||||
|
||||
# =======================
|
||||
# DB UPDATE TRIGGER TESTS
|
||||
# =======================
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue