From 80d02c434ba930a8ff40efa3e0021cf827b98306 Mon Sep 17 00:00:00 2001 From: Rebecca Law Date: Mon, 29 Oct 2018 16:57:06 +0000 Subject: [PATCH] Add validation-failed and virus-scan-failed in the failed counts for stats --- app/service/statistics.py | 4 +++- tests/app/service/test_statistics.py | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/app/service/statistics.py b/app/service/statistics.py index 9b76f4d0f..10bff90b3 100644 --- a/app/service/statistics.py +++ b/app/service/statistics.py @@ -83,7 +83,9 @@ def _update_statuses_from_row(update_dict, row): update_dict['requested'] += row.count if row.status in ('delivered', 'sent'): update_dict['delivered'] += row.count - elif row.status in ('failed', 'technical-failure', 'temporary-failure', 'permanent-failure'): + elif row.status in ( + 'failed', 'technical-failure', 'temporary-failure', + 'permanent-failure', 'validation-failed', 'virus-scan-failed'): update_dict['failed'] += row.count diff --git a/tests/app/service/test_statistics.py b/tests/app/service/test_statistics.py index d002ea4bc..cde1a67a3 100644 --- a/tests/app/service/test_statistics.py +++ b/tests/app/service/test_statistics.py @@ -35,7 +35,9 @@ NewStatsRow = collections.namedtuple('row', ('notification_type', 'status', 'key StatsRow('email', 'technical-failure', 1), StatsRow('email', 'temporary-failure', 1), StatsRow('email', 'permanent-failure', 1), - ], [4, 0, 4], [0, 0, 0], [0, 0, 0]), + StatsRow('email', 'validation-failed', 1), + StatsRow('email', 'virus-scan-failed', 1), + ], [6, 0, 6], [0, 0, 0], [0, 0, 0]), 'convert_sent_to_delivered': ([ StatsRow('sms', 'sending', 1), StatsRow('sms', 'delivered', 1),