diff --git a/backend/Property.py b/backend/Property.py index 704e4f0a..b15c9f25 100644 --- a/backend/Property.py +++ b/backend/Property.py @@ -1224,7 +1224,15 @@ class Property: if "air_source_heat_pump" not in measures: return False - suitable_property_type = self.data["property-type"] in ["House", "Bungalow"] + suitable_house = self.data["property-type"] == "House" and self.data["built-form"] in [ + "Detached", "Semi-Detached", + ] + + suitable_bungalow = self.data["property-type"] == "Bungalow" and self.data["built-form"] in [ + "Detached", "Semi-Detached" + ] + + suitable_property_type = suitable_house or suitable_bungalow has_air_source_heat_pump = self.main_heating["has_air_source_heat_pump"] return suitable_property_type and not has_air_source_heat_pump diff --git a/recommendations/tests/test_data/heating_recommendations_data.py b/recommendations/tests/test_data/heating_recommendations_data.py index 0281a26d..78f6c7bf 100644 --- a/recommendations/tests/test_data/heating_recommendations_data.py +++ b/recommendations/tests/test_data/heating_recommendations_data.py @@ -405,11 +405,18 @@ testing_examples = [ 'construction-age-band': 'England and Wales: 1930-1949', 'lodgement-datetime': '2013-07-23 14:20:29', 'tenure': 'owner-occupied', 'fixed-lighting-outlets-count': 10.0, 'low-energy-fixed-light-count': 9.0, 'uprn': 100070358594, - 'uprn-source': 'Address Matched' + 'uprn-source': 'Address Matched', 'sheating-energy-eff': None, 'sheating-env-eff': None }, - "heating_recommendation_descriptions": [], + "heating_recommendation_descriptions": [ + 'Upgrade to a new condensing boiler upgrade heating controls to Room thermostat, programmer and TRVs', + 'Install high heat retention electric storage heaters. upgrade heating controls to High Heat Retention ' + 'Storage Heater Controls', + 'Upgrade to a new condensing boiler upgrade heating controls to Smart Thermostats, room sensors and smart ' + 'radiator valves (time & temperature zone control)' + ], "heating_controls_recommendation_descriptions": [], - "notes": "" + "notes": "This property has assumed electric heating and is mid-terrace house. It has a mains gas connection." + "We can recommend a boiler upgrade and high heat retention storage heaters" } ] diff --git a/recommendations/tests/test_heating_recommendations.py b/recommendations/tests/test_heating_recommendations.py index 4351623b..35373729 100644 --- a/recommendations/tests/test_heating_recommendations.py +++ b/recommendations/tests/test_heating_recommendations.py @@ -54,9 +54,6 @@ class TestHeatingRecommendations: :return: """ - if test_case["epc"]["uprn"] == 100021560521: - raise Exception("Finish this test - could do so while on the train") - epc_records = {"original_epc": test_case["epc"].copy(), "full_sap_epc": {}, "old_data": []} epc_record = EPCRecord(