From f42cf3bd22e9cb23722e7e5306e501a69fb3b4df Mon Sep 17 00:00:00 2001 From: Kenneth Kehl <@kkehl@flexion.us> Date: Thu, 7 Mar 2024 09:59:58 -0800 Subject: [PATCH] rebreak the tests to reflect reality --- app/main/views/jobs.py | 2 +- tests/app/main/views/test_activity.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/main/views/jobs.py b/app/main/views/jobs.py index 3f48cb9ec..99506fa51 100644 --- a/app/main/views/jobs.py +++ b/app/main/views/jobs.py @@ -272,7 +272,7 @@ def get_status_filters(service, message_type, statistics): if message_type is None: stats = { key: sum(statistics[message_type][key] for message_type in {"email", "sms"}) - for key in {"requested", "delivered", "failed"} + for key in {"requested", "delivered", "failure"} } else: stats = statistics[message_type] diff --git a/tests/app/main/views/test_activity.py b/tests/app/main/views/test_activity.py index 936bfac80..29a0341de 100644 --- a/tests/app/main/views/test_activity.py +++ b/tests/app/main/views/test_activity.py @@ -531,12 +531,13 @@ def test_time_left(job_created_at, expected_message): assert get_time_left(job_created_at) == expected_message -STATISTICS = {"sms": {"requested": 6, "failed": 2, "delivered": 1, "pending": 3}} +STATISTICS = {"sms": {"requested": 6, "failed": 2, "delivered": 1}} def test_get_status_filters_calculates_stats(client_request): ret = get_status_filters(Service({"id": "foo"}), "sms", STATISTICS) + # TODO WHY DO WE THINK THE PENDING COUNT SHOULD BE 3? HOW DID THIS WORK BEFORE? assert {label: count for label, _option, _link, count in ret} == { "total": 6, "pending": 3,