mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-01 23:55:58 -05:00
Set count as live to false for broadcast services
We think it would be a security risk to show the name of services involved in emergency alerts as they be responsible for things such as counter terrorism. On top of that, showing broadcast services in the list of all services could enable someone to use that information to try and trick an admin into letting them access of a particular service given the fact they know the name of it
This commit is contained in:
@@ -3759,3 +3759,21 @@ def test_set_as_broadcast_service_maintains_broadcast_permission_for_existing_br
|
||||
|
||||
permissions = ServicePermission.query.filter_by(service_id=sample_broadcast_service.id).all()
|
||||
assert [p.permission for p in permissions] == [BROADCAST_TYPE]
|
||||
|
||||
|
||||
def test_set_as_broadcast_service_sets_count_as_live_to_false(client, notify_db, sample_service):
|
||||
assert sample_service.count_as_live == True
|
||||
|
||||
resp = client.post(
|
||||
'/service/{}/set-as-broadcast-service'.format(sample_service.id),
|
||||
data=json.dumps({
|
||||
'broadcast_channel': "severe",
|
||||
}),
|
||||
headers=[('Content-Type', 'application/json'), create_authorization_header()]
|
||||
)
|
||||
result = resp.json
|
||||
assert resp.status_code == 200
|
||||
assert result['data']['count_as_live'] == False
|
||||
|
||||
service_from_db = Service.query.filter_by(id=sample_service.id).all()[0]
|
||||
assert service_from_db.count_as_live == False
|
||||
|
||||
Reference in New Issue
Block a user