mirror of
https://github.com/GSA/notifications-api.git
synced 2026-08-25 00:33:41 -04:00
Merge branch 'master' into remove-nasty-query-from-dashboard
This commit is contained in:
@@ -5,7 +5,7 @@ import uuid
|
||||
from unittest.mock import ANY
|
||||
|
||||
import pytest
|
||||
from flask import url_for
|
||||
from flask import url_for, current_app
|
||||
from freezegun import freeze_time
|
||||
|
||||
from app.dao.users_dao import save_model_user
|
||||
@@ -144,6 +144,7 @@ def test_get_service_by_id(client, sample_service):
|
||||
assert json_resp['data']['organisation'] is None
|
||||
assert json_resp['data']['branding'] == 'govuk'
|
||||
assert json_resp['data']['dvla_organisation'] == '001'
|
||||
assert json_resp['data']['sms_sender'] == current_app.config['FROM_NUMBER']
|
||||
|
||||
|
||||
def test_get_service_by_id_should_404_if_no_service(notify_api, notify_db):
|
||||
@@ -213,6 +214,7 @@ def test_create_service(client, sample_user):
|
||||
assert json_resp['data']['email_from'] == 'created.service'
|
||||
assert not json_resp['data']['research_mode']
|
||||
assert json_resp['data']['dvla_organisation'] == '001'
|
||||
assert json_resp['data']['sms_sender'] == current_app.config['FROM_NUMBER']
|
||||
|
||||
auth_header_fetch = create_authorization_header()
|
||||
|
||||
|
||||
@@ -106,8 +106,9 @@ def test_send_notification_to_service_users_sends_to_active_users_only(
|
||||
|
||||
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 notifications[0].to == first_active_user.email_address
|
||||
assert notifications[1].to == second_active_user.email_address
|
||||
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