remove last obvious letter tasks and queues

This commit is contained in:
stvnrlly
2022-12-07 21:52:00 -05:00
parent d6f35cf6da
commit 90f3dde344
6 changed files with 2 additions and 90 deletions

View File

@@ -9,9 +9,7 @@ from app.celery.nightly_tasks import (
_delete_notifications_older_than_retention_by_type,
delete_email_notifications_older_than_retention,
delete_inbound_sms,
delete_letter_notifications_older_than_retention,
delete_sms_notifications_older_than_retention,
remove_letter_csv_files,
remove_sms_email_csv_files,
s3,
save_daily_notification_processing_time,
@@ -128,8 +126,6 @@ def test_remove_csv_files_filters_by_type(mocker, sample_service):
job_to_delete = create_job(template=letter_template, created_at=eight_days_ago)
create_job(template=sms_template, created_at=eight_days_ago)
remove_letter_csv_files()
assert s3.remove_job_from_s3.call_args_list == [
call(job_to_delete.service_id, job_to_delete.id),
]
@@ -148,12 +144,6 @@ def test_delete_email_notifications_older_than_retentions_calls_child_task(notif
mocked_notifications.assert_called_once_with('email')
def test_delete_letter_notifications_older_than_retention_calls_child_task(notify_api, mocker):
mocked = mocker.patch('app.celery.nightly_tasks._delete_notifications_older_than_retention_by_type')
delete_letter_notifications_older_than_retention()
mocked.assert_called_once_with('letter')
def test_should_not_update_status_of_letter_notifications(client, sample_letter_template):
created_at = datetime.utcnow() - timedelta(days=5)
not1 = create_notification(template=sample_letter_template, status='sending', created_at=created_at)

View File

@@ -156,29 +156,6 @@ def test_move_notifications_deletes_letters_sent_and_in_final_state_from_table_a
s3.get_object(Bucket=bucket_name, Key=filename)
@pytest.mark.parametrize('notification_status', ['pending-virus-check', 'created', 'sending'])
@pytest.mark.skip(reason="Skipping letter-related functionality for now")
def test_move_notifications_does_not_delete_letters_not_yet_in_final_state(
sample_service, mocker, notification_status
):
mock_s3_object = mocker.patch("app.dao.notifications_dao.find_letter_pdf_in_s3").return_value
letter_template = create_template(service=sample_service, template_type='letter')
create_notification(
template=letter_template,
status=notification_status,
reference='LETTER_REF',
created_at=datetime.utcnow() - timedelta(days=8),
)
assert Notification.query.count() == 1
assert NotificationHistory.query.count() == 0
move_notifications_to_notification_history('letter', sample_service.id, datetime.utcnow())
assert Notification.query.count() == 1
assert NotificationHistory.query.count() == 0
mock_s3_object.assert_not_called()
def test_move_notifications_only_moves_notifications_older_than_provided_timestamp(sample_template):
delete_time = datetime(2020, 6, 1, 12)
one_second_before = delete_time - timedelta(seconds=1)

View File

@@ -4,7 +4,7 @@ from app.config import QueueNames
def test_queue_names_all_queues_correct():
# Need to ensure that all_queues() only returns queue names used in API
queues = QueueNames.all_queues()
assert len(queues) == 17
assert len(queues) == 15
assert set([
QueueNames.PRIORITY,
QueueNames.PERIODIC,
@@ -16,10 +16,8 @@ def test_queue_names_all_queues_correct():
QueueNames.JOBS,
QueueNames.RETRY,
QueueNames.NOTIFY,
QueueNames.CREATE_LETTERS_PDF,
QueueNames.CALLBACKS,
QueueNames.CALLBACKS_RETRY,
QueueNames.LETTERS,
QueueNames.SMS_CALLBACKS,
QueueNames.SAVE_API_EMAIL,
QueueNames.SAVE_API_SMS,