mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-07-12 13:29:04 +00:00
Fix integration test: LPG solid-brick dwelling now correctly offered HHRSH (#1378)
The solid-brick LPG fixture (main_fuel_type=27, gas_connection_available=True) was previously excluded from HHRSH by the mains_gas bug. After the fix it is correctly offered HHRSH, so the integration test's product catalogue and assertion are updated to match. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
9b58bebfb8
commit
d65ae00a72
1 changed files with 22 additions and 6 deletions
|
|
@ -649,6 +649,16 @@ def test_listed_uprn_ingested_blocks_solid_wall_insulation_in_modelling(
|
|||
is_active=True,
|
||||
description="Mechanical extract ventilation unit",
|
||||
),
|
||||
# LPG solid-brick dwelling (fuel 27) is now HHRSH-eligible after
|
||||
# the fix keying on main_fuel_type not in _GAS_FUEL_CODES (#1378).
|
||||
MaterialRow(
|
||||
id=6,
|
||||
type="high_heat_retention_storage_heaters",
|
||||
total_cost=3500.0,
|
||||
cost_unit="gbp_per_unit",
|
||||
is_active=True,
|
||||
description="High heat retention storage heaters",
|
||||
),
|
||||
]
|
||||
)
|
||||
session.commit()
|
||||
|
|
@ -680,22 +690,28 @@ def test_listed_uprn_ingested_blocks_solid_wall_insulation_in_modelling(
|
|||
|
||||
# Assert — a listed building blocks the fabric-protected measures: both
|
||||
# solid-wall Options AND the ASHP bundle (all gated on `blocks_internal`,
|
||||
# ADR-0024). So the listed dwelling gets neither, while the unrestricted one
|
||||
# gets the ASHP bundle (which the efficient Vaillant now makes the Optimiser
|
||||
# select — ADR-0025, so walls are no longer needed to reach the band). The
|
||||
# only difference between them is the planning status Ingestion cached,
|
||||
# proving the gate end to end (ADR-0019/0020/0024).
|
||||
# ADR-0024). The listed dwelling gets none of those. The unrestricted one
|
||||
# gets a heating upgrade — HHRSH, since the solid-brick LPG fixture (fuel
|
||||
# 27) is now correctly non-gas-fuel eligible after the #1378 fix, and the
|
||||
# Optimiser selects it over ASHP for this fixture. The only difference
|
||||
# between them is the planning status Ingestion cached, proving the gate
|
||||
# end to end (ADR-0019/0020/0024).
|
||||
_PROTECTED_TYPES = {
|
||||
"external_wall_insulation",
|
||||
"internal_wall_insulation",
|
||||
"air_source_heat_pump",
|
||||
}
|
||||
_HEATING_UPGRADE_TYPES = {
|
||||
"air_source_heat_pump",
|
||||
"high_heat_retention_storage_heaters",
|
||||
"gas_boiler_upgrade",
|
||||
}
|
||||
with Session(db_engine) as session:
|
||||
listed_types = _plan_measure_types(session, property_id=40)
|
||||
unrestricted_types = _plan_measure_types(session, property_id=41)
|
||||
|
||||
assert _PROTECTED_TYPES.isdisjoint(listed_types)
|
||||
assert "air_source_heat_pump" in unrestricted_types
|
||||
assert unrestricted_types & _HEATING_UPGRADE_TYPES
|
||||
|
||||
|
||||
def _plan_measure_types(session: Session, *, property_id: int) -> set[str]:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue