From eb58851e93abb2c4f4c2136a76913e61627aa28c Mon Sep 17 00:00:00 2001 From: Chris Hill-Scott Date: Tue, 6 Oct 2020 11:53:00 +0100 Subject: [PATCH] =?UTF-8?q?Explicitly=20test=20that=20stats=20endpoint=20i?= =?UTF-8?q?sn=E2=80=99t=20called?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If we know a service has no jobs, we shouldn’t check to see if it has scheduled jobs. --- tests/app/main/views/test_dashboard.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/app/main/views/test_dashboard.py b/tests/app/main/views/test_dashboard.py index 17c908d87..90eb91c76 100644 --- a/tests/app/main/views/test_dashboard.py +++ b/tests/app/main/views/test_dashboard.py @@ -888,6 +888,7 @@ def test_should_not_show_upcoming_jobs_on_dashboard_if_service_has_no_jobs( mock_get_template_statistics, mock_get_service_statistics, mock_has_no_jobs, + mock_get_scheduled_job_stats, mock_get_usage, mock_get_free_sms_fragment_limit, mock_get_inbound_sms_summary, @@ -898,6 +899,7 @@ def test_should_not_show_upcoming_jobs_on_dashboard_if_service_has_no_jobs( service_id=SERVICE_ONE_ID, ) mock_has_no_jobs.assert_called_once_with(SERVICE_ONE_ID) + assert mock_get_scheduled_job_stats.called is False assert 'In the next few days' not in page.select_one('main').text assert 'files waiting to send ' not in page.select_one('main').text