From 6a6ffb695c1cc1ce2e908750da9e7d2ad8012aef Mon Sep 17 00:00:00 2001 From: Khalim Conn-Kowlessar Date: Mon, 13 Jul 2026 23:14:13 +0000 Subject: [PATCH] =?UTF-8?q?Carry=20the=20Plan's=20post-works=20figures=20o?= =?UTF-8?q?nto=20the=20export=20row=20=F0=9F=9F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 4.8 (1M context) --- .../scenario_export/test_scenario_sheet.py | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) 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"] == ""