broadcast-areas: view test does not assert order

the descriptions are liable to change esp for wards

Signed-off-by: Toby Lorne <toby.lornewelch-richards@digital.cabinet-office.gov.uk>
This commit is contained in:
Toby Lorne
2020-08-10 13:04:03 +01:00
parent 7a1b80e533
commit 8c3a8ecd04

View File

@@ -226,25 +226,21 @@ def test_choose_broadcast_library_page(
service_id=SERVICE_ONE_ID,
broadcast_message_id=fake_uuid,
)
assert [
(normalize_spaces(title.text), normalize_spaces(hint.text))
for title, hint in list(zip(
page.select('.file-list-filename-large'), page.select('.file-list-hint-large')
))
] == [
(
'Counties and Unitary Authorities in England and Wales',
'Barking and Dagenham, Barnet, Barnsley and 171 more…',
),
(
'Countries',
'England, Northern Ireland, Scotland and Wales',
),
(
'Regions of England',
'East Midlands, East of England, London and 6 more…',
),
titles = [
normalize_spaces(title.text)
for title in page.select('.file-list-filename-large')
]
assert sorted(titles) == sorted([
'Counties and Unitary Authorities in England and Wales',
'Countries',
'Regions of England',
])
hints = page.select('.file-list-hint-large')
for country in ('England, Northern Ireland, Scotland, Wales'):
assert country in hints
assert page.select_one('a.file-list-filename-large.govuk-link')['href'] == url_for(
'.choose_broadcast_area',
service_id=SERVICE_ONE_ID,