diff --git a/app/broadcast_areas/__init__.py b/app/broadcast_areas/__init__.py index c9e40ec89..338763fe3 100644 --- a/app/broadcast_areas/__init__.py +++ b/app/broadcast_areas/__init__.py @@ -80,9 +80,8 @@ class BroadcastArea(SortableMixin): @property def estimated_bleed_in_m(self): - if self.id.endswith(CITY_OF_LONDON.WARDS): - return 500 - return 5_900 - (math.log(self.phone_density, 10) * 1_250) + estimated_bleed = 5_900 - (math.log(self.phone_density, 10) * 1_250) + return max(500, min(estimated_bleed, 5000)) @property def estimated_bleed_in_degrees(self): diff --git a/tests/app/broadcast_areas/test_broadcast_area.py b/tests/app/broadcast_areas/test_broadcast_area.py index 7c904ce55..705916cb5 100644 --- a/tests/app/broadcast_areas/test_broadcast_area.py +++ b/tests/app/broadcast_areas/test_broadcast_area.py @@ -315,7 +315,7 @@ def test_phone_density( @pytest.mark.parametrize('area, expected_bleed_in_m, expected_bleed_in_degrees', ( ( # Islington (most dense in UK) - 'lad20-E09000019', 488, 0.00439 + 'lad20-E09000019', 500, 0.00449 ), ( # Cordwainer Ward (City of London) @@ -332,7 +332,7 @@ def test_phone_density( ), ( # Highland (least dense in UK) - 'lad20-S12000017', 5_095, 0.0458 + 'lad20-S12000017', 5_000, 0.0449 ), )) def test_estimated_bleed( diff --git a/tests/app/main/views/test_broadcast.py b/tests/app/main/views/test_broadcast.py index ba473e376..2fa9a5140 100644 --- a/tests/app/main/views/test_broadcast.py +++ b/tests/app/main/views/test_broadcast.py @@ -649,7 +649,7 @@ def test_broadcast_page( 'Islington remove', ], [ 'An area of 9.7 square miles Will get the alert', - 'An extra area of 4.6 square miles is Likely to get the alert', + 'An extra area of 4.7 square miles is Likely to get the alert', '200,000 to 300,000 phones', ]), ))