mirror of
https://github.com/GSA/notifications-api.git
synced 2026-07-18 13:40:31 -04:00
Merge pull request #3167 from alphagov/broadcast_services_history
Add service versioning to broadcast account type change
This commit is contained in:
@@ -4059,3 +4059,23 @@ def test_set_as_broadcast_service_errors_if_no_mobile_provider_restriction(
|
||||
_data=data,
|
||||
_expected_status=400,
|
||||
)
|
||||
|
||||
|
||||
def test_set_as_broadcast_service_updates_services_history(
|
||||
admin_request, sample_service, broadcast_organisation
|
||||
):
|
||||
old_history_records = Service.get_history_model().query.filter_by(id=sample_service.id).all()
|
||||
data = {
|
||||
'broadcast_channel': 'test',
|
||||
'service_mode': 'live',
|
||||
'provider_restriction': None,
|
||||
}
|
||||
|
||||
admin_request.post(
|
||||
'service.set_as_broadcast_service',
|
||||
service_id=sample_service.id,
|
||||
_data=data,
|
||||
)
|
||||
|
||||
new_history_records = Service.get_history_model().query.filter_by(id=sample_service.id).all()
|
||||
assert len(new_history_records) == len(old_history_records) + 1
|
||||
|
||||
Reference in New Issue
Block a user