Carry the Plan's post-works figures onto the export row 🟥

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Khalim Conn-Kowlessar 2026-07-13 23:14:13 +00:00
parent 91c88743f7
commit 6a6ffb695c

View file

@ -165,3 +165,29 @@ def test_solar_pv_with_a_battery_pivots_to_its_own_battery_column() -> None:
assert row["solar_pv_with_battery"] == 6000.0
assert row["solar_pv"] == ""
assert row["total_retrofit_cost"] == 6000.0
def test_plan_post_works_figures_come_from_the_plan_row_blank_when_absent() -> None:
# arrange — a Property whose default Plan carries the SAP calculator's
# post-works figures; the contingency figure happens to be absent.
prop = _property(
post_sap_points=78.0,
post_epc_rating="C",
cost_of_works=4200.0,
co2_savings=1.8,
energy_bill_savings=350.0,
energy_consumption_savings=4100.0,
valuation_increase=15000.0,
)
# act
sheet = shape_scenario_sheet([prop])
# assert — the persisted Plan figures pass through directly (no recompute,
# ADR-0065); an absent figure is blank rather than zero.
row = sheet.rows[0]
assert row["post_sap_points"] == 78.0
assert row["post_epc_rating"] == "C"
assert row["cost_of_works"] == 4200.0
assert row["valuation_increase"] == 15000.0
assert row["contingency_cost"] == ""