remove LETTER_TYPE from NOTIFICATION_TYPES

This commit is contained in:
stvnrlly
2023-02-24 15:30:05 -05:00
parent 0a3260c030
commit f55b7bf931
6 changed files with 24 additions and 44 deletions

View File

@@ -28,17 +28,12 @@ NewStatsRow = collections.namedtuple('row', ('notification_type', 'status', 'key
'dont_mix_template_types': ([
StatsRow('email', 'delivered', 1),
StatsRow('sms', 'delivered', 1),
StatsRow('letter', 'delivered', 1)
], [1, 1, 0], [1, 1, 0], [1, 1, 0]),
'convert_fail_statuses_to_failed': ([
StatsRow('email', 'failed', 1),
StatsRow('email', 'technical-failure', 1),
StatsRow('email', 'temporary-failure', 1),
StatsRow('email', 'permanent-failure', 1),
StatsRow('letter', 'validation-failed', 1),
StatsRow('letter', 'virus-scan-failed', 1),
StatsRow('letter', 'permanent-failure', 1),
StatsRow('letter', 'cancelled', 1),
], [4, 0, 4], [0, 0, 0], [3, 0, 3]),
'convert_sent_to_delivered': ([
StatsRow('sms', 'sending', 1),
@@ -66,18 +61,11 @@ def test_format_statistics(stats, email_counts, sms_counts, letter_counts):
in zip(['requested', 'delivered', 'failed'], sms_counts)
}
assert ret['letter'] == {
status: count
for status, count
in zip(['requested', 'delivered', 'failed'], letter_counts)
}
def test_create_zeroed_stats_dicts():
assert create_zeroed_stats_dicts() == {
'sms': {'requested': 0, 'delivered': 0, 'failed': 0},
'email': {'requested': 0, 'delivered': 0, 'failed': 0},
'letter': {'requested': 0, 'delivered': 0, 'failed': 0},
}
@@ -166,7 +154,7 @@ def test_create_empty_monthly_notification_status_stats_dict(year, expected_year
output = create_empty_monthly_notification_status_stats_dict(year)
assert sorted(output.keys()) == expected_years
for v in output.values():
assert v == {'sms': {}, 'email': {}, 'letter': {}}
assert v == {'sms': {}, 'email': {}}
@freeze_time('2018-06-01 04:59:59')
@@ -194,7 +182,7 @@ def test_add_monthly_notification_status_stats():
add_monthly_notification_status_stats(data, rows)
assert data == {
'2018-04': {'sms': {'sending': 1, 'delivered': 2}, 'email': {'sending': 4}, 'letter': {}},
'2018-05': {'sms': {'sending': 24}, 'email': {'sending': 32}, 'letter': {}},
'2018-06': {'sms': {}, 'email': {}, 'letter': {}},
'2018-04': {'sms': {'sending': 1, 'delivered': 2}, 'email': {'sending': 4}},
'2018-05': {'sms': {'sending': 24}, 'email': {'sending': 32}},
'2018-06': {'sms': {}, 'email': {}},
}