mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-25 08:44:23 -04:00
fix remaining tests
This commit is contained in:
@@ -2319,25 +2319,31 @@ def test_warns_if_file_sent_already_errors(
|
||||
"app.main.views.send.get_csv_metadata",
|
||||
return_value={"original_file_name": uploaded_file_name},
|
||||
)
|
||||
# Should be botocore.errorfactory.NoSuchKey but for some reason can't use that
|
||||
with pytest.raises( # noqa: PT011,PT012 # Requires more research on how to refactor.
|
||||
expected_exception=Exception
|
||||
|
||||
with pytest.raises(
|
||||
expected_exception=Exception, match="Unable to locate credentials"
|
||||
):
|
||||
page = client_request.get(
|
||||
"main.check_messages",
|
||||
service_id=SERVICE_ONE_ID,
|
||||
template_id="5d729fbd-239c-44ab-b498-75a985f3198f",
|
||||
upload_id=fake_uuid,
|
||||
original_file_name=uploaded_file_name,
|
||||
_test_page_title=False,
|
||||
stmt_for_test_warns_if_file_sent_already_errors(
|
||||
client_request, uploaded_file_name, fake_uuid, mock_get_jobs
|
||||
)
|
||||
|
||||
assert normalize_spaces(page.select_one(".banner-dangerous").text) == (
|
||||
"These messages have already been sent today "
|
||||
"If you need to resend them, rename the file and upload it again."
|
||||
)
|
||||
|
||||
mock_get_jobs.assert_called_once_with(SERVICE_ONE_ID, limit_days=0)
|
||||
def stmt_for_test_warns_if_file_sent_already_errors(
|
||||
client_request, uploaded_file_name, fake_uuid, mock_get_jobs
|
||||
):
|
||||
page = client_request.get(
|
||||
"main.check_messages",
|
||||
service_id=SERVICE_ONE_ID,
|
||||
template_id="5d729fbd-239c-44ab-b498-75a985f3198f",
|
||||
upload_id=fake_uuid,
|
||||
original_file_name=uploaded_file_name,
|
||||
_test_page_title=False,
|
||||
)
|
||||
assert normalize_spaces(page.select_one(".banner-dangerous").text) == (
|
||||
"These messages have already been sent today "
|
||||
"If you need to resend them, rename the file and upload it again."
|
||||
)
|
||||
mock_get_jobs.assert_called_once_with(SERVICE_ONE_ID, limit_days=0)
|
||||
|
||||
|
||||
def test_check_messages_column_error_doesnt_show_optional_columns(
|
||||
|
||||
Reference in New Issue
Block a user