A property without override or EPC falls back to the legacy column 🟥

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

View file

@ -220,6 +220,26 @@ def test_epc_without_property_type_falls_back_to_dwelling_type(
assert [p.property_id for p in resolved] == [fallback]
def test_property_without_epc_falls_back_to_the_legacy_column(
db_engine: Engine,
) -> None:
# arrange — no override, no EPC rows; only property.property_type
with Session(db_engine) as session:
legacy = _seed_property(session, portfolio_id=814)
session.get_one(PropertyRow, legacy).property_type = "Bungalow"
session.commit()
# act
resolved = resolve_filtered_property_ids(
session,
portfolio_id=814,
filters=PropertyGroupFilters(property_types=["Bungalow"]),
)
# assert
assert [p.property_id for p in resolved] == [legacy]
def test_postcode_filter_matches_exactly(db_engine: Engine) -> None:
# arrange
with Session(db_engine) as session: