Fix misleading name for overlap method

Resolves: https://github.com/alphagov/notifications-admin/pull/3980#discussion_r692919874

Previously it was unclear what kinds of areas this method returned,
and whether there would be any duplicates (due to the hierarchy of
areas we work with). This clarifies that.

In addition, the areas returned may not overlap with the custom one
[1], so we should reword to avoid falsely implying that. We could do
the overlap check as part of the method as an alternative, but that
would create extra work when calculating the ratio of intersection.
We could always add "overlapping areas" as a complementary method to
this one in future.

[1]: https://github.com/alphagov/notifications-admin/pull/3980#discussion_r692919874
This commit is contained in:
Ben Thorner
2021-08-23 16:50:56 +01:00
parent d2784d0d8a
commit 427ac0c8c1
2 changed files with 4 additions and 3 deletions

View File

@@ -386,7 +386,7 @@ def test_count_of_phones_for_custom_area(
)
assert sorted(
overlap.name for overlap in area.overlapping_areas
overlap.name for overlap in area.nearby_electoral_wards
) == expected_possible_overlaps
assert close_enough(area.count_of_phones, expected_count_of_phones)