diff --git a/tests/domain/scenario_export/test_scenario_sheet.py b/tests/domain/scenario_export/test_scenario_sheet.py index e21e633a2..54d35e37e 100644 --- a/tests/domain/scenario_export/test_scenario_sheet.py +++ b/tests/domain/scenario_export/test_scenario_sheet.py @@ -142,3 +142,26 @@ def test_total_retrofit_cost_sums_the_per_measure_costs() -> None: # assert — the package total is the sum of the measure costs. assert sheet.rows[0]["total_retrofit_cost"] == 2000.0 + + +def test_solar_pv_with_a_battery_pivots_to_its_own_battery_column() -> None: + # arrange — a solar_pv Option that includes a battery. + prop = _property( + measures=[ + _measure( + measure_type="solar_pv", estimated_cost=6000.0, includes_battery=True + ) + ] + ) + + # act + sheet = shape_scenario_sheet([prop]) + + # assert — the cost lands in the battery variant column (a stable part of the + # contract), the plain solar_pv column stays blank, and the total still + # counts it. + assert "solar_pv_with_battery" in sheet.columns + row = sheet.rows[0] + assert row["solar_pv_with_battery"] == 6000.0 + assert row["solar_pv"] == "" + assert row["total_retrofit_cost"] == 6000.0