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