mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-09-11 10:28:41 -04:00
Order areas by name in examples
When you click through to the page for a library you see the available areas in alphabetical order. The examples given for each library should match this.
This commit is contained in:
@@ -121,7 +121,7 @@ class BroadcastAreasRepository(object):
|
|||||||
),
|
),
|
||||||
area_count AS (SELECT COUNT(*) AS c FROM areas),
|
area_count AS (SELECT COUNT(*) AS c FROM areas),
|
||||||
subset_area_count AS (SELECT c - 4 FROM area_count),
|
subset_area_count AS (SELECT c - 4 FROM area_count),
|
||||||
description_area_names AS (SELECT name FROM areas LIMIT 4),
|
description_area_names AS (SELECT name FROM areas ORDER BY name ASC LIMIT 4),
|
||||||
description_areas_joined AS (
|
description_areas_joined AS (
|
||||||
SELECT GROUP_CONCAT(name, ", ") FROM description_area_names
|
SELECT GROUP_CONCAT(name, ", ") FROM description_area_names
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -51,17 +51,17 @@ def test_examples():
|
|||||||
assert countries == 'England, Northern Ireland, Scotland, Wales'
|
assert countries == 'England, Northern Ireland, Scotland, Wales'
|
||||||
|
|
||||||
regions = broadcast_area_libraries.get('regions-of-england').get_examples()
|
regions = broadcast_area_libraries.get('regions-of-england').get_examples()
|
||||||
assert regions == 'North East, North West, Yorkshire and The Humber, East Midlands, and 5 more…'
|
assert regions == 'East Midlands, East of England, London, North East, and 5 more…'
|
||||||
|
|
||||||
counties = broadcast_area_libraries.get(
|
counties = broadcast_area_libraries.get(
|
||||||
'counties-and-unitary-authorities-in-england-and-wales',
|
'counties-and-unitary-authorities-in-england-and-wales',
|
||||||
).get_examples()
|
).get_examples()
|
||||||
assert counties == 'Hartlepool, Middlesbrough, Redcar and Cleveland, Stockton-on-Tees, and 170 more…'
|
assert counties == 'Barking and Dagenham, Barnet, Barnsley, Bath and North East Somerset, and 170 more…'
|
||||||
|
|
||||||
wards = broadcast_area_libraries.get(
|
wards = broadcast_area_libraries.get(
|
||||||
'electoral-wards-of-the-united-kingdom',
|
'electoral-wards-of-the-united-kingdom',
|
||||||
).get_examples()
|
).get_examples()
|
||||||
assert wards == 'Hartlepool, Middlesbrough, Redcar and Cleveland, Stockton-on-Tees, and 375 more…'
|
assert wards == 'Aberdeen City, Aberdeenshire, Adur, Allerdale, and 375 more…'
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.parametrize('id', (
|
@pytest.mark.parametrize('id', (
|
||||||
|
|||||||
Reference in New Issue
Block a user