mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-07-12 13:29:04 +00:00
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:
parent
dfe42a6374
commit
9b146dfaf4
1 changed files with 24 additions and 0 deletions
|
|
@ -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:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue