mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-07-12 13:29:04 +00:00
Postcode filter matches the canonical postcode exactly 🟥
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
parent
3836729f92
commit
b865e89195
1 changed files with 17 additions and 0 deletions
|
|
@ -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]
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue