From 860b071f66d53b6b33ece36e9555493a1534e6b0 Mon Sep 17 00:00:00 2001 From: Chris Hill-Scott Date: Wed, 5 Oct 2016 16:05:41 +0100 Subject: [PATCH] Test for query parameters in either order MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit They’re not deterministic, and were causing intermittant test failures. --- tests/app/main/views/test_jobs.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/app/main/views/test_jobs.py b/tests/app/main/views/test_jobs.py index ab2813a57..876073533 100644 --- a/tests/app/main/views/test_jobs.py +++ b/tests/app/main/views/test_jobs.py @@ -335,6 +335,17 @@ def test_can_show_notifications( page=expected_page_argument ) == page.find("div", {'data-key': 'notifications'})['data-resource'] + path_to_json = page.find("div", {'data-key': 'notifications'})['data-resource'] + + assert ( + '/services/{}/notifications/{}.json?status={}&page={}'.format( + service_one['id'], message_type, status_argument, expected_page_argument + ) in path_to_json or + '/services/{}/notifications/{}.json?page={}&status={}'.format( + service_one['id'], message_type, expected_page_argument, status_argument + ) in path_to_json + ) + mock_get_notifications.assert_called_with( limit_days=7, page=expected_page_argument,