diff --git a/tests/domain/scenario_export/test_scenario_sheet.py b/tests/domain/scenario_export/test_scenario_sheet.py index 54d35e37e..44d756c3d 100644 --- a/tests/domain/scenario_export/test_scenario_sheet.py +++ b/tests/domain/scenario_export/test_scenario_sheet.py @@ -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"] == ""