Postcode filter matches the canonical postcode exactly 🟥

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Khalim Conn-Kowlessar 2026-07-07 11:33:29 +00:00
parent 3836729f92
commit b865e89195

View file

@ -47,3 +47,20 @@ def test_no_filters_resolves_the_whole_portfolio_minus_deletions(
# assert
assert resolved == [FilteredProperty(property_id=kept, postcode="B93 8SU")]
assert deleted not in [p.property_id for p in resolved]
def test_postcode_filter_matches_exactly(db_engine: Engine) -> None:
# arrange
with Session(db_engine) as session:
in_area = _seed_property(session, portfolio_id=814, postcode="B93 8SU")
_elsewhere = _seed_property(session, portfolio_id=814, postcode="M20 4TF")
# act
resolved = resolve_filtered_property_ids(
session,
portfolio_id=814,
filters=PropertyGroupFilters(postcodes=["B93 8SU"]),
)
# assert
assert [p.property_id for p in resolved] == [in_area]