mirror of
https://github.com/GSA/notifications-api.git
synced 2026-01-31 15:15:38 -05:00
notify-api-742 don't write phone numbers to db
This commit is contained in:
@@ -13,17 +13,15 @@ def test_send_notification_to_service_users_persists_notifications_correctly(
|
||||
):
|
||||
mocker.patch("app.service.sender.send_notification_to_queue")
|
||||
|
||||
user = sample_service.users[0]
|
||||
template = create_template(sample_service, template_type=notification_type)
|
||||
send_notification_to_service_users(
|
||||
service_id=sample_service.id, template_id=template.id
|
||||
)
|
||||
to = user.email_address if notification_type == EMAIL_TYPE else user.mobile_number
|
||||
|
||||
notification = Notification.query.one()
|
||||
|
||||
assert Notification.query.count() == 1
|
||||
assert notification.to == to
|
||||
assert notification.to == "1"
|
||||
assert str(notification.service_id) == current_app.config["NOTIFY_SERVICE_ID"]
|
||||
assert notification.template.id == template.id
|
||||
assert notification.template.template_type == notification_type
|
||||
@@ -87,10 +85,5 @@ def test_send_notification_to_service_users_sends_to_active_users_only(
|
||||
template = create_template(service, template_type=EMAIL_TYPE)
|
||||
|
||||
send_notification_to_service_users(service_id=service.id, template_id=template.id)
|
||||
notifications = Notification.query.all()
|
||||
notifications_recipients = [notification.to for notification in notifications]
|
||||
|
||||
assert Notification.query.count() == 2
|
||||
assert pending_user.email_address not in notifications_recipients
|
||||
assert first_active_user.email_address in notifications_recipients
|
||||
assert second_active_user.email_address in notifications_recipients
|
||||
|
||||
Reference in New Issue
Block a user