mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-23 15:57:23 -04:00
Merge pull request #3553 from alphagov/move-broadcast-areas-into-admin
Move broadcast areas into admin
This commit is contained in:
@@ -38,7 +38,7 @@ sample_uuid = sample_uuid()
|
||||
403, 403,
|
||||
),
|
||||
(
|
||||
'.remove_broadcast_area', {'broadcast_message_id': sample_uuid, 'area_slug': 'england'},
|
||||
'.remove_broadcast_area', {'broadcast_message_id': sample_uuid, 'area_slug': 'countries-E92000001'},
|
||||
403, 405,
|
||||
),
|
||||
(
|
||||
@@ -226,25 +226,22 @@ 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',
|
||||
'Electoral Wards of the United Kingdom',
|
||||
'Regions of England',
|
||||
])
|
||||
|
||||
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',
|
||||
service_id=SERVICE_ONE_ID,
|
||||
@@ -282,14 +279,14 @@ def test_add_broadcast_area(
|
||||
broadcast_message_id=fake_uuid,
|
||||
library_slug='countries',
|
||||
_data={
|
||||
'areas': ['england', 'wales']
|
||||
'areas': ['countries-E92000001', 'countries-W92000004']
|
||||
}
|
||||
)
|
||||
mock_update_broadcast_message.assert_called_once_with(
|
||||
service_id=SERVICE_ONE_ID,
|
||||
broadcast_message_id=fake_uuid,
|
||||
data={
|
||||
'areas': ['england', 'scotland', 'wales']
|
||||
'areas': ['countries-E92000001', 'countries-S92000003', 'countries-W92000004']
|
||||
},
|
||||
)
|
||||
|
||||
@@ -306,7 +303,7 @@ def test_remove_broadcast_area_page(
|
||||
'.remove_broadcast_area',
|
||||
service_id=SERVICE_ONE_ID,
|
||||
broadcast_message_id=fake_uuid,
|
||||
area_slug='england',
|
||||
area_slug='countries-E92000001',
|
||||
_expected_redirect=url_for(
|
||||
'.preview_broadcast_areas',
|
||||
service_id=SERVICE_ONE_ID,
|
||||
@@ -318,7 +315,7 @@ def test_remove_broadcast_area_page(
|
||||
service_id=SERVICE_ONE_ID,
|
||||
broadcast_message_id=fake_uuid,
|
||||
data={
|
||||
'areas': ['scotland']
|
||||
'areas': ['countries-S92000003']
|
||||
},
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user