broadcast-areas: examples are deterministic

Signed-off-by: Toby Lorne <toby.lornewelch-richards@digital.cabinet-office.gov.uk>
This commit is contained in:
Toby Lorne
2020-08-11 11:33:27 +01:00
parent 73e68c355b
commit b0ff2d41c5
3 changed files with 23 additions and 28 deletions

View File

@@ -232,19 +232,15 @@ def test_choose_broadcast_library_page(
for title in page.select('.file-list-filename-large')
]
assert sorted(titles) == sorted([
'Counties and Unitary Authorities in England and Wales',
'Countries',
'Electoral Wards of the United Kingdom',
'Regions of England',
'Counties and Unitary Authorities in England and Wales',
'Countries',
'Electoral Wards of the United Kingdom',
'Regions of England',
])
assert any([
all([
country in hint.text
for country in ('England', 'Northern Ireland', 'Scotland', 'Wales')
])
for hint in page.select('.file-list-hint-large')
])
assert normalize_spaces(page.select('.file-list-hint-large')[1].text) == (
'England, Northern Ireland, Scotland, Wales'
)
assert page.select_one('a.file-list-filename-large.govuk-link')['href'] == url_for(
'.choose_broadcast_area',