mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-04 10:21:14 -05:00
Merge branch 'master' into vb-remove-ip-whitelist
This commit is contained in:
@@ -42,7 +42,7 @@ def create_invited_user(service_id):
|
|||||||
notification_type=EMAIL_TYPE,
|
notification_type=EMAIL_TYPE,
|
||||||
api_key_id=None,
|
api_key_id=None,
|
||||||
key_type=KEY_TYPE_NORMAL,
|
key_type=KEY_TYPE_NORMAL,
|
||||||
reply_to_text=service.get_default_reply_to_email_address()
|
reply_to_text=invited_user.from_user.email_address
|
||||||
)
|
)
|
||||||
|
|
||||||
send_notification_to_queue(saved_notification, False, queue=QueueNames.NOTIFY)
|
send_notification_to_queue(saved_notification, False, queue=QueueNames.NOTIFY)
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ def test_create_invited_user(admin_request, sample_service, mocker, invitation_e
|
|||||||
assert json_resp['data']['id']
|
assert json_resp['data']['id']
|
||||||
|
|
||||||
notification = Notification.query.first()
|
notification = Notification.query.first()
|
||||||
assert notification.reply_to_text == "notify@gov.uk"
|
assert notification.reply_to_text == invite_from.email_address
|
||||||
mocked.assert_called_once_with([(str(notification.id))], queue="notify-internal-tasks")
|
mocked.assert_called_once_with([(str(notification.id))], queue="notify-internal-tasks")
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
23
tests/test_manifest_delivery_base.py
Normal file
23
tests/test_manifest_delivery_base.py
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
import yaml
|
||||||
|
|
||||||
|
from app.config import QueueNames
|
||||||
|
|
||||||
|
|
||||||
|
def test_queue_names_set_in_manifest_delivery_base_correctly():
|
||||||
|
with open("manifest-delivery-base.yml", 'r') as stream:
|
||||||
|
search = ' -Q '
|
||||||
|
yml_commands = [y['command'] for y in yaml.load(stream)['applications']]
|
||||||
|
|
||||||
|
watched_queues = set()
|
||||||
|
for command in yml_commands:
|
||||||
|
start_of_queue_arg = command.find(search)
|
||||||
|
if start_of_queue_arg > 0:
|
||||||
|
start_of_queue_names = start_of_queue_arg + len(search)
|
||||||
|
queues = command[start_of_queue_names:].split(',')
|
||||||
|
watched_queues.update(queues)
|
||||||
|
|
||||||
|
# ses-callbacks isn't used in api (only used in SNS lambda)
|
||||||
|
ignored_queues = {'ses-callbacks'}
|
||||||
|
watched_queues -= ignored_queues
|
||||||
|
|
||||||
|
assert watched_queues == set(QueueNames.all_queues())
|
||||||
Reference in New Issue
Block a user