An EPC without property_type falls back to its dwelling_type 🟥

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Khalim Conn-Kowlessar 2026-07-07 11:39:10 +00:00
parent dfe42a6374
commit 9b146dfaf4

View file

@ -196,6 +196,30 @@ def test_epc_numeric_property_type_codes_map_to_labels(db_engine: Engine) -> Non
assert [p.property_id for p in resolved] == [coded]
def test_epc_without_property_type_falls_back_to_dwelling_type(
db_engine: Engine,
) -> None:
# arrange — cert lodged with no property_type column, only dwelling_type
with Session(db_engine) as session:
fallback = _seed_property(session, portfolio_id=814)
_seed_epc(
session,
property_id=fallback,
property_type=None,
dwelling_type="Bungalow",
)
# act
resolved = resolve_filtered_property_ids(
session,
portfolio_id=814,
filters=PropertyGroupFilters(property_types=["Bungalow"]),
)
# assert
assert [p.property_id for p in resolved] == [fallback]
def test_postcode_filter_matches_exactly(db_engine: Engine) -> None:
# arrange
with Session(db_engine) as session: