mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-03 01:41:05 -05:00
Co-locate tests for sending a notification
I found the send letter tests hard to find as the name of the file didn't match the name of the one containing the code under test.
This commit is contained in:
1279
tests/app/service/send_notification/test_send_notification.py
Normal file
1279
tests/app/service/send_notification/test_send_notification.py
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,491 @@
|
||||
import uuid
|
||||
from unittest.mock import Mock
|
||||
|
||||
import pytest
|
||||
from notifications_utils import SMS_CHAR_COUNT_LIMIT
|
||||
from notifications_utils.recipients import InvalidPhoneError
|
||||
|
||||
from app.config import QueueNames
|
||||
from app.dao.service_guest_list_dao import (
|
||||
dao_add_and_commit_guest_list_contacts,
|
||||
)
|
||||
from app.models import (
|
||||
EMAIL_TYPE,
|
||||
KEY_TYPE_NORMAL,
|
||||
LETTER_TYPE,
|
||||
MOBILE_TYPE,
|
||||
PRIORITY,
|
||||
SMS_TYPE,
|
||||
Notification,
|
||||
ServiceGuestList,
|
||||
)
|
||||
from app.service.send_notification import send_one_off_notification
|
||||
from app.v2.errors import BadRequestError, TooManyRequestsError
|
||||
from tests.app.db import (
|
||||
create_letter_contact,
|
||||
create_reply_to_email,
|
||||
create_service,
|
||||
create_service_sms_sender,
|
||||
create_template,
|
||||
create_user,
|
||||
)
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def persist_mock(mocker):
|
||||
noti = Mock(id=uuid.uuid4())
|
||||
return mocker.patch('app.service.send_notification.persist_notification', return_value=noti)
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def celery_mock(mocker):
|
||||
return mocker.patch('app.service.send_notification.send_notification_to_queue')
|
||||
|
||||
|
||||
def test_send_one_off_notification_calls_celery_correctly(persist_mock, celery_mock, notify_db_session):
|
||||
service = create_service()
|
||||
template = create_template(service=service)
|
||||
|
||||
service = template.service
|
||||
|
||||
post_data = {
|
||||
'template_id': str(template.id),
|
||||
'to': '07700 900 001',
|
||||
'created_by': str(service.created_by_id)
|
||||
}
|
||||
|
||||
resp = send_one_off_notification(service.id, post_data)
|
||||
|
||||
assert resp == {
|
||||
'id': str(persist_mock.return_value.id)
|
||||
}
|
||||
|
||||
celery_mock.assert_called_once_with(
|
||||
notification=persist_mock.return_value,
|
||||
research_mode=False,
|
||||
queue=None
|
||||
)
|
||||
|
||||
|
||||
def test_send_one_off_notification_calls_persist_correctly_for_sms(
|
||||
persist_mock,
|
||||
celery_mock,
|
||||
notify_db_session
|
||||
):
|
||||
service = create_service()
|
||||
template = create_template(
|
||||
service=service,
|
||||
template_type=SMS_TYPE,
|
||||
content="Hello (( Name))\nYour thing is due soon",
|
||||
)
|
||||
|
||||
post_data = {
|
||||
'template_id': str(template.id),
|
||||
'to': '07700 900 001',
|
||||
'personalisation': {'name': 'foo'},
|
||||
'created_by': str(service.created_by_id)
|
||||
}
|
||||
|
||||
send_one_off_notification(service.id, post_data)
|
||||
|
||||
persist_mock.assert_called_once_with(
|
||||
template_id=template.id,
|
||||
template_version=template.version,
|
||||
recipient=post_data['to'],
|
||||
service=template.service,
|
||||
personalisation={'name': 'foo'},
|
||||
notification_type=SMS_TYPE,
|
||||
api_key_id=None,
|
||||
key_type=KEY_TYPE_NORMAL,
|
||||
created_by_id=str(service.created_by_id),
|
||||
reply_to_text='testing',
|
||||
reference=None,
|
||||
postage=None,
|
||||
client_reference=None
|
||||
)
|
||||
|
||||
|
||||
def test_send_one_off_notification_calls_persist_correctly_for_international_sms(
|
||||
persist_mock,
|
||||
celery_mock,
|
||||
notify_db_session
|
||||
):
|
||||
service = create_service(service_permissions=['sms', 'international_sms'])
|
||||
template = create_template(
|
||||
service=service,
|
||||
template_type=SMS_TYPE,
|
||||
)
|
||||
|
||||
post_data = {
|
||||
'template_id': str(template.id),
|
||||
'to': '+1 555 0100',
|
||||
'personalisation': {'name': 'foo'},
|
||||
'created_by': str(service.created_by_id)
|
||||
}
|
||||
|
||||
send_one_off_notification(service.id, post_data)
|
||||
|
||||
assert persist_mock.call_args[1]['recipient'] == '+1 555 0100'
|
||||
|
||||
|
||||
def test_send_one_off_notification_calls_persist_correctly_for_email(
|
||||
persist_mock,
|
||||
celery_mock,
|
||||
notify_db_session
|
||||
):
|
||||
service = create_service()
|
||||
template = create_template(
|
||||
service=service,
|
||||
template_type=EMAIL_TYPE,
|
||||
subject="Test subject",
|
||||
content="Hello (( Name))\nYour thing is due soon",
|
||||
)
|
||||
|
||||
post_data = {
|
||||
'template_id': str(template.id),
|
||||
'to': 'test@example.com',
|
||||
'personalisation': {'name': 'foo'},
|
||||
'created_by': str(service.created_by_id)
|
||||
}
|
||||
|
||||
send_one_off_notification(service.id, post_data)
|
||||
|
||||
persist_mock.assert_called_once_with(
|
||||
template_id=template.id,
|
||||
template_version=template.version,
|
||||
recipient=post_data['to'],
|
||||
service=template.service,
|
||||
personalisation={'name': 'foo'},
|
||||
notification_type=EMAIL_TYPE,
|
||||
api_key_id=None,
|
||||
key_type=KEY_TYPE_NORMAL,
|
||||
created_by_id=str(service.created_by_id),
|
||||
reply_to_text=None,
|
||||
reference=None,
|
||||
postage=None,
|
||||
client_reference=None
|
||||
)
|
||||
|
||||
|
||||
def test_send_one_off_notification_calls_persist_correctly_for_letter(
|
||||
mocker,
|
||||
persist_mock,
|
||||
celery_mock,
|
||||
notify_db_session
|
||||
):
|
||||
mocker.patch(
|
||||
'app.service.send_notification.create_random_identifier',
|
||||
return_value='this-is-random-in-real-life',
|
||||
)
|
||||
service = create_service()
|
||||
template = create_template(
|
||||
service=service,
|
||||
template_type=LETTER_TYPE,
|
||||
postage='first',
|
||||
subject="Test subject",
|
||||
content="Hello (( Name))\nYour thing is due soon",
|
||||
)
|
||||
|
||||
post_data = {
|
||||
'template_id': str(template.id),
|
||||
'to': 'First Last',
|
||||
'personalisation': {
|
||||
'name': 'foo',
|
||||
'address_line_1': 'First Last',
|
||||
'address_line_2': '1 Example Street',
|
||||
'postcode': 'SW1A 1AA',
|
||||
},
|
||||
'created_by': str(service.created_by_id)
|
||||
}
|
||||
|
||||
send_one_off_notification(service.id, post_data)
|
||||
|
||||
persist_mock.assert_called_once_with(
|
||||
template_id=template.id,
|
||||
template_version=template.version,
|
||||
recipient=post_data['to'],
|
||||
service=template.service,
|
||||
personalisation=post_data['personalisation'],
|
||||
notification_type=LETTER_TYPE,
|
||||
api_key_id=None,
|
||||
key_type=KEY_TYPE_NORMAL,
|
||||
created_by_id=str(service.created_by_id),
|
||||
reply_to_text=None,
|
||||
reference='this-is-random-in-real-life',
|
||||
postage='first',
|
||||
client_reference=None
|
||||
)
|
||||
|
||||
|
||||
def test_send_one_off_notification_honors_research_mode(notify_db_session, persist_mock, celery_mock):
|
||||
service = create_service(research_mode=True)
|
||||
template = create_template(service=service)
|
||||
|
||||
post_data = {
|
||||
'template_id': str(template.id),
|
||||
'to': '07700 900 001',
|
||||
'created_by': str(service.created_by_id)
|
||||
}
|
||||
|
||||
send_one_off_notification(service.id, post_data)
|
||||
|
||||
assert celery_mock.call_args[1]['research_mode'] is True
|
||||
|
||||
|
||||
def test_send_one_off_notification_honors_priority(notify_db_session, persist_mock, celery_mock):
|
||||
service = create_service()
|
||||
template = create_template(service=service)
|
||||
template.process_type = PRIORITY
|
||||
|
||||
post_data = {
|
||||
'template_id': str(template.id),
|
||||
'to': '07700 900 001',
|
||||
'created_by': str(service.created_by_id)
|
||||
}
|
||||
|
||||
send_one_off_notification(service.id, post_data)
|
||||
|
||||
assert celery_mock.call_args[1]['queue'] == QueueNames.PRIORITY
|
||||
|
||||
|
||||
def test_send_one_off_notification_raises_if_invalid_recipient(notify_db_session):
|
||||
service = create_service()
|
||||
template = create_template(service=service)
|
||||
|
||||
post_data = {
|
||||
'template_id': str(template.id),
|
||||
'to': 'not a phone number',
|
||||
'created_by': str(service.created_by_id)
|
||||
}
|
||||
|
||||
with pytest.raises(InvalidPhoneError):
|
||||
send_one_off_notification(service.id, post_data)
|
||||
|
||||
|
||||
@pytest.mark.parametrize('recipient', [
|
||||
'07700 900 001', # not in team or guest_list
|
||||
'07700900123', # in guest_list
|
||||
'+447700-900-123', # in guest_list in different format
|
||||
])
|
||||
def test_send_one_off_notification_raises_if_cant_send_to_recipient(
|
||||
notify_db_session,
|
||||
recipient,
|
||||
):
|
||||
service = create_service(restricted=True)
|
||||
template = create_template(service=service)
|
||||
dao_add_and_commit_guest_list_contacts([
|
||||
ServiceGuestList.from_string(service.id, MOBILE_TYPE, '07700900123'),
|
||||
])
|
||||
|
||||
post_data = {
|
||||
'template_id': str(template.id),
|
||||
'to': recipient,
|
||||
'created_by': str(service.created_by_id)
|
||||
}
|
||||
|
||||
with pytest.raises(BadRequestError) as e:
|
||||
send_one_off_notification(service.id, post_data)
|
||||
|
||||
assert 'service is in trial mode' in e.value.message
|
||||
|
||||
|
||||
def test_send_one_off_notification_raises_if_over_limit(notify_db_session, mocker):
|
||||
service = create_service(message_limit=0)
|
||||
template = create_template(service=service)
|
||||
mocker.patch(
|
||||
'app.service.send_notification.check_service_over_daily_message_limit',
|
||||
side_effect=TooManyRequestsError(1)
|
||||
)
|
||||
|
||||
post_data = {
|
||||
'template_id': str(template.id),
|
||||
'to': '07700 900 001',
|
||||
'created_by': str(service.created_by_id)
|
||||
}
|
||||
|
||||
with pytest.raises(TooManyRequestsError):
|
||||
send_one_off_notification(service.id, post_data)
|
||||
|
||||
|
||||
def test_send_one_off_notification_raises_if_message_too_long(persist_mock, notify_db_session):
|
||||
service = create_service()
|
||||
template = create_template(service=service, content="Hello (( Name))\nYour thing is due soon")
|
||||
|
||||
post_data = {
|
||||
'template_id': str(template.id),
|
||||
'to': '07700 900 001',
|
||||
'personalisation': {'name': '🚫' * 1000},
|
||||
'created_by': str(service.created_by_id)
|
||||
}
|
||||
|
||||
with pytest.raises(BadRequestError) as e:
|
||||
send_one_off_notification(service.id, post_data)
|
||||
|
||||
assert e.value.message == f'Your message is too long. ' \
|
||||
f'Text messages cannot be longer than {SMS_CHAR_COUNT_LIMIT} characters. ' \
|
||||
f'Your message is {1029} characters long.'
|
||||
|
||||
|
||||
def test_send_one_off_notification_fails_if_created_by_other_service(sample_template):
|
||||
user_not_in_service = create_user(email='some-other-user@gov.uk')
|
||||
|
||||
post_data = {
|
||||
'template_id': str(sample_template.id),
|
||||
'to': '07700 900 001',
|
||||
'created_by': str(user_not_in_service.id)
|
||||
}
|
||||
|
||||
with pytest.raises(BadRequestError) as e:
|
||||
send_one_off_notification(sample_template.service_id, post_data)
|
||||
|
||||
assert e.value.message == 'Can’t create notification - Test User is not part of the "Sample service" service'
|
||||
|
||||
|
||||
def test_send_one_off_notification_should_add_email_reply_to_text_for_notification(sample_email_template, celery_mock):
|
||||
reply_to_email = create_reply_to_email(sample_email_template.service, 'test@test.com')
|
||||
data = {
|
||||
'to': 'ok@ok.com',
|
||||
'template_id': str(sample_email_template.id),
|
||||
'sender_id': reply_to_email.id,
|
||||
'created_by': str(sample_email_template.service.created_by_id)
|
||||
}
|
||||
|
||||
notification_id = send_one_off_notification(service_id=sample_email_template.service.id, post_data=data)
|
||||
notification = Notification.query.get(notification_id['id'])
|
||||
celery_mock.assert_called_once_with(
|
||||
notification=notification,
|
||||
research_mode=False,
|
||||
queue=None
|
||||
)
|
||||
assert notification.reply_to_text == reply_to_email.email_address
|
||||
|
||||
|
||||
def test_send_one_off_letter_notification_should_use_template_reply_to_text(sample_letter_template, celery_mock):
|
||||
letter_contact = create_letter_contact(sample_letter_template.service, "Edinburgh, ED1 1AA", is_default=False)
|
||||
sample_letter_template.reply_to = str(letter_contact.id)
|
||||
|
||||
data = {
|
||||
'to': 'user@example.com',
|
||||
'template_id': str(sample_letter_template.id),
|
||||
'personalisation': {
|
||||
'name': 'foo',
|
||||
'address_line_1': 'First Last',
|
||||
'address_line_2': '1 Example Street',
|
||||
'address_line_3': 'SW1A 1AA',
|
||||
},
|
||||
'created_by': str(sample_letter_template.service.created_by_id)
|
||||
}
|
||||
|
||||
notification_id = send_one_off_notification(service_id=sample_letter_template.service.id, post_data=data)
|
||||
notification = Notification.query.get(notification_id['id'])
|
||||
celery_mock.assert_called_once_with(
|
||||
notification=notification,
|
||||
research_mode=False,
|
||||
queue=None
|
||||
)
|
||||
|
||||
assert notification.reply_to_text == "Edinburgh, ED1 1AA"
|
||||
|
||||
|
||||
def test_send_one_off_letter_should_not_make_pdf_in_research_mode(sample_letter_template):
|
||||
|
||||
sample_letter_template.service.research_mode = True
|
||||
|
||||
data = {
|
||||
'to': 'A. Name',
|
||||
'template_id': str(sample_letter_template.id),
|
||||
'personalisation': {
|
||||
'name': 'foo',
|
||||
'address_line_1': 'First Last',
|
||||
'address_line_2': '1 Example Street',
|
||||
'address_line_3': 'SW1A 1AA',
|
||||
},
|
||||
'created_by': str(sample_letter_template.service.created_by_id)
|
||||
}
|
||||
|
||||
notification = send_one_off_notification(service_id=sample_letter_template.service.id, post_data=data)
|
||||
notification = Notification.query.get(notification['id'])
|
||||
|
||||
assert notification.status == "delivered"
|
||||
|
||||
|
||||
def test_send_one_off_sms_notification_should_use_sms_sender_reply_to_text(sample_service, celery_mock):
|
||||
template = create_template(service=sample_service, template_type=SMS_TYPE)
|
||||
sms_sender = create_service_sms_sender(
|
||||
service=sample_service,
|
||||
sms_sender='07123123123',
|
||||
is_default=False
|
||||
)
|
||||
|
||||
data = {
|
||||
'to': '07111111111',
|
||||
'template_id': str(template.id),
|
||||
'created_by': str(sample_service.created_by_id),
|
||||
'sender_id': str(sms_sender.id),
|
||||
}
|
||||
|
||||
notification_id = send_one_off_notification(service_id=sample_service.id, post_data=data)
|
||||
notification = Notification.query.get(notification_id['id'])
|
||||
celery_mock.assert_called_once_with(
|
||||
notification=notification,
|
||||
research_mode=False,
|
||||
queue=None
|
||||
)
|
||||
|
||||
assert notification.reply_to_text == "447123123123"
|
||||
|
||||
|
||||
def test_send_one_off_sms_notification_should_use_default_service_reply_to_text(sample_service, celery_mock):
|
||||
template = create_template(service=sample_service, template_type=SMS_TYPE)
|
||||
sample_service.service_sms_senders[0].is_default = False
|
||||
create_service_sms_sender(
|
||||
service=sample_service,
|
||||
sms_sender='07123123456',
|
||||
is_default=True
|
||||
)
|
||||
|
||||
data = {
|
||||
'to': '07111111111',
|
||||
'template_id': str(template.id),
|
||||
'created_by': str(sample_service.created_by_id),
|
||||
}
|
||||
|
||||
notification_id = send_one_off_notification(service_id=sample_service.id, post_data=data)
|
||||
notification = Notification.query.get(notification_id['id'])
|
||||
celery_mock.assert_called_once_with(
|
||||
notification=notification,
|
||||
research_mode=False,
|
||||
queue=None
|
||||
)
|
||||
|
||||
assert notification.reply_to_text == "447123123456"
|
||||
|
||||
|
||||
def test_send_one_off_notification_should_throw_exception_if_reply_to_id_doesnot_exist(
|
||||
sample_email_template
|
||||
):
|
||||
data = {
|
||||
'to': 'ok@ok.com',
|
||||
'template_id': str(sample_email_template.id),
|
||||
'sender_id': str(uuid.uuid4()),
|
||||
'created_by': str(sample_email_template.service.created_by_id)
|
||||
}
|
||||
|
||||
with pytest.raises(expected_exception=BadRequestError) as e:
|
||||
send_one_off_notification(service_id=sample_email_template.service.id, post_data=data)
|
||||
assert e.value.message == 'Reply to email address not found'
|
||||
|
||||
|
||||
def test_send_one_off_notification_should_throw_exception_if_sms_sender_id_doesnot_exist(
|
||||
sample_template
|
||||
):
|
||||
data = {
|
||||
'to': '07700 900 001',
|
||||
'template_id': str(sample_template.id),
|
||||
'sender_id': str(uuid.uuid4()),
|
||||
'created_by': str(sample_template.service.created_by_id)
|
||||
}
|
||||
|
||||
with pytest.raises(expected_exception=BadRequestError) as e:
|
||||
send_one_off_notification(service_id=sample_template.service.id, post_data=data)
|
||||
assert e.value.message == 'SMS sender not found'
|
||||
@@ -0,0 +1,130 @@
|
||||
import pytest
|
||||
from freezegun import freeze_time
|
||||
from notifications_utils.s3 import S3ObjectNotFound
|
||||
|
||||
from app.dao.notifications_dao import get_notification_by_id
|
||||
from app.models import EMAIL_TYPE, LETTER_TYPE, UPLOAD_LETTERS
|
||||
from app.service.send_notification import send_pdf_letter_notification
|
||||
from app.v2.errors import BadRequestError, TooManyRequestsError
|
||||
from tests.app.db import create_service
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def post_data(sample_service_full_permissions, fake_uuid):
|
||||
return {
|
||||
'filename': 'valid.pdf',
|
||||
'created_by': sample_service_full_permissions.users[0].id,
|
||||
'file_id': fake_uuid,
|
||||
'postage': 'second',
|
||||
'recipient_address': 'Bugs%20Bunny%0A123%20Main%20Street%0ALooney%20Town'
|
||||
}
|
||||
|
||||
|
||||
@pytest.mark.parametrize('permissions', [
|
||||
[EMAIL_TYPE],
|
||||
[UPLOAD_LETTERS],
|
||||
])
|
||||
def test_send_pdf_letter_notification_raises_error_if_service_does_not_have_permission(
|
||||
notify_db_session,
|
||||
permissions,
|
||||
post_data,
|
||||
):
|
||||
service = create_service(service_permissions=permissions)
|
||||
|
||||
with pytest.raises(BadRequestError):
|
||||
send_pdf_letter_notification(service.id, post_data)
|
||||
|
||||
|
||||
def test_send_pdf_letter_notification_raises_error_if_service_is_over_daily_message_limit(
|
||||
mocker,
|
||||
sample_service_full_permissions,
|
||||
post_data,
|
||||
):
|
||||
mocker.patch(
|
||||
'app.service.send_notification.check_service_over_daily_message_limit',
|
||||
side_effect=TooManyRequestsError(10))
|
||||
|
||||
with pytest.raises(TooManyRequestsError):
|
||||
send_pdf_letter_notification(sample_service_full_permissions.id, post_data)
|
||||
|
||||
|
||||
def test_send_pdf_letter_notification_validates_created_by(
|
||||
sample_service_full_permissions,
|
||||
sample_user,
|
||||
post_data
|
||||
):
|
||||
post_data['created_by'] = sample_user.id
|
||||
|
||||
with pytest.raises(BadRequestError):
|
||||
send_pdf_letter_notification(sample_service_full_permissions.id, post_data)
|
||||
|
||||
|
||||
def test_send_pdf_letter_notification_raises_error_if_service_in_trial_mode(
|
||||
mocker,
|
||||
sample_service_full_permissions,
|
||||
post_data,
|
||||
):
|
||||
sample_service_full_permissions.restricted = True
|
||||
|
||||
with pytest.raises(BadRequestError) as e:
|
||||
send_pdf_letter_notification(sample_service_full_permissions.id, post_data)
|
||||
assert 'trial mode' in e.value.message
|
||||
|
||||
|
||||
def test_send_pdf_letter_notification_raises_error_when_pdf_is_not_in_transient_letter_bucket(
|
||||
mocker,
|
||||
sample_service_full_permissions,
|
||||
notify_user,
|
||||
post_data,
|
||||
):
|
||||
mocker.patch('app.service.send_notification.utils_s3download', side_effect=S3ObjectNotFound({}, ''))
|
||||
|
||||
with pytest.raises(S3ObjectNotFound):
|
||||
send_pdf_letter_notification(sample_service_full_permissions.id, post_data)
|
||||
|
||||
|
||||
def test_send_pdf_letter_notification_does_nothing_if_notification_already_exists(
|
||||
mocker,
|
||||
sample_service_full_permissions,
|
||||
notify_user,
|
||||
sample_notification,
|
||||
post_data,
|
||||
):
|
||||
post_data['file_id'] = sample_notification.id
|
||||
mocker.patch('app.service.send_notification.utils_s3download', side_effect=S3ObjectNotFound({}, ''))
|
||||
response = send_pdf_letter_notification(sample_service_full_permissions.id, post_data)
|
||||
assert response['id'] == str(sample_notification.id)
|
||||
|
||||
|
||||
@freeze_time("2019-08-02 11:00:00")
|
||||
def test_send_pdf_letter_notification_creates_notification_and_moves_letter(
|
||||
mocker,
|
||||
sample_service_full_permissions,
|
||||
notify_user,
|
||||
post_data,
|
||||
):
|
||||
mocker.patch('app.service.send_notification.utils_s3download')
|
||||
mocker.patch('app.service.send_notification.get_page_count', return_value=1)
|
||||
s3_mock = mocker.patch('app.service.send_notification.move_uploaded_pdf_to_letters_bucket')
|
||||
|
||||
result = send_pdf_letter_notification(sample_service_full_permissions.id, post_data)
|
||||
file_id = post_data['file_id']
|
||||
|
||||
notification = get_notification_by_id(file_id)
|
||||
|
||||
assert str(notification.id) == file_id
|
||||
assert notification.api_key_id is None
|
||||
assert notification.client_reference == post_data['filename']
|
||||
assert notification.created_by_id == post_data['created_by']
|
||||
assert notification.postage == 'second'
|
||||
assert notification.notification_type == LETTER_TYPE
|
||||
assert notification.billable_units == 1
|
||||
assert notification.to == "Bugs Bunny\n123 Main Street\nLooney Town"
|
||||
|
||||
assert notification.service_id == sample_service_full_permissions.id
|
||||
assert result == {'id': str(notification.id)}
|
||||
|
||||
s3_mock.assert_called_once_with(
|
||||
'service-{}/{}.pdf'.format(sample_service_full_permissions.id, file_id),
|
||||
'2019-08-02/NOTIFY.{}.D.2.C.20190802110000.PDF'.format(notification.reference)
|
||||
)
|
||||
Reference in New Issue
Block a user