Delete old 'process-virus-scan-passed-task'

This has been replaced by a new task, `sanitise-letter`, to this deletes
all the code in the old task and ensures that when antivirus is not
enabled locally we are calling the new task.
This commit is contained in:
Katie Smith
2020-03-10 15:15:58 +00:00
parent e07dea27e1
commit 6ac89c9a2f
5 changed files with 12 additions and 531 deletions

View File

@@ -7,7 +7,6 @@ from freezegun import freeze_time
from moto import mock_s3
from app.letters.utils import (
copy_redaction_failed_pdf,
get_bucket_name_and_prefix_for_notification,
get_letter_pdf_filename,
get_letter_pdf_and_metadata,
@@ -294,24 +293,6 @@ def test_move_failed_pdf_scan_failed(notify_api):
assert filename not in [o.key for o in bucket.objects.all()]
@mock_s3
@freeze_time(FROZEN_DATE_TIME)
def test_copy_redaction_failed_pdf(notify_api):
filename = 'test.pdf'
bucket_name = current_app.config['LETTERS_SCAN_BUCKET_NAME']
conn = boto3.resource('s3', region_name='eu-west-1')
bucket = conn.create_bucket(Bucket=bucket_name)
s3 = boto3.client('s3', region_name='eu-west-1')
s3.put_object(Bucket=bucket_name, Key=filename, Body=b'pdf_content')
copy_redaction_failed_pdf(filename)
assert 'REDACTION_FAILURE/' + filename in [o.key for o in bucket.objects.all()]
assert filename in [o.key for o in bucket.objects.all()]
@pytest.mark.parametrize("freeze_date, expected_folder_name",
[("2018-04-01 17:50:00", "2018-04-02/"),
("2018-07-02 16:29:00", "2018-07-02/"),