mirror of
https://github.com/GSA/notifications-api.git
synced 2026-09-07 15:08:25 -04:00
Don't send test letters to dvla to print
This commit is contained in:
@@ -742,7 +742,8 @@ def dao_get_letters_to_be_printed(print_run_date):
|
|||||||
notifications = Notification.query.filter(
|
notifications = Notification.query.filter(
|
||||||
Notification.created_at < convert_bst_to_utc(last_processing_deadline),
|
Notification.created_at < convert_bst_to_utc(last_processing_deadline),
|
||||||
Notification.notification_type == LETTER_TYPE,
|
Notification.notification_type == LETTER_TYPE,
|
||||||
Notification.status == NOTIFICATION_CREATED
|
Notification.status == NOTIFICATION_CREATED,
|
||||||
|
Notification.key_type == KEY_TYPE_NORMAL
|
||||||
).order_by(
|
).order_by(
|
||||||
Notification.created_at
|
Notification.created_at
|
||||||
).all()
|
).all()
|
||||||
|
|||||||
@@ -281,6 +281,15 @@ def test_get_key_and_size_of_letters_to_be_sent_to_print(notify_api, mocker, sam
|
|||||||
created_at=(datetime.now() - timedelta(minutes=1)).isoformat()
|
created_at=(datetime.now() - timedelta(minutes=1)).isoformat()
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# test notification we don't expect to get sent
|
||||||
|
create_notification(
|
||||||
|
template=sample_letter_template,
|
||||||
|
status='created',
|
||||||
|
reference='ref4',
|
||||||
|
created_at=(datetime.now() - timedelta(days=1)).isoformat(),
|
||||||
|
key_type=KEY_TYPE_TEST
|
||||||
|
)
|
||||||
|
|
||||||
mock_s3 = mocker.patch('app.celery.tasks.s3.head_s3_object', side_effect=[
|
mock_s3 = mocker.patch('app.celery.tasks.s3.head_s3_object', side_effect=[
|
||||||
{'ContentLength': 2},
|
{'ContentLength': 2},
|
||||||
{'ContentLength': 1},
|
{'ContentLength': 1},
|
||||||
|
|||||||
Reference in New Issue
Block a user