mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-02 09:26:08 -05:00
Move provider restriction into broadcast settings
This means we will have a much easier way of knowing what the settings are for a broadcast service. Note, we can just move data directly into the newer table as there is nothing on the API or admin app that is putting data in the `service_broadcast_provider_restriction` table, this was being done manually for the few services that needed it.
This commit is contained in:
@@ -9,7 +9,6 @@ from app.models import (
|
||||
BroadcastStatusType,
|
||||
BroadcastEventMessageType,
|
||||
BroadcastProviderMessageStatus,
|
||||
ServiceBroadcastProviderRestriction,
|
||||
ServiceBroadcastSettings,
|
||||
)
|
||||
from app.celery.broadcast_message_tasks import send_broadcast_event, send_broadcast_provider_message, trigger_link_test
|
||||
@@ -47,10 +46,8 @@ def test_send_broadcast_event_only_sends_to_one_provider_if_set_on_service(
|
||||
notify_api,
|
||||
sample_service
|
||||
):
|
||||
notify_db.session.add(ServiceBroadcastProviderRestriction(
|
||||
service=sample_service,
|
||||
provider='vodafone'
|
||||
))
|
||||
settings = ServiceBroadcastSettings(service=sample_service, channel="test", provider="vodafone")
|
||||
notify_db.session.add(settings)
|
||||
|
||||
template = create_template(sample_service, BROADCAST_TYPE)
|
||||
broadcast_message = create_broadcast_message(template, status=BroadcastStatusType.BROADCASTING)
|
||||
@@ -74,10 +71,8 @@ def test_send_broadcast_event_does_nothing_if_provider_set_on_service_isnt_enabl
|
||||
notify_api,
|
||||
sample_service
|
||||
):
|
||||
notify_db.session.add(ServiceBroadcastProviderRestriction(
|
||||
service=sample_service,
|
||||
provider='three'
|
||||
))
|
||||
settings = ServiceBroadcastSettings(service=sample_service, channel="test", provider="three")
|
||||
notify_db.session.add(settings)
|
||||
|
||||
template = create_template(sample_service, BROADCAST_TYPE)
|
||||
broadcast_message = create_broadcast_message(template, status=BroadcastStatusType.BROADCASTING)
|
||||
|
||||
Reference in New Issue
Block a user