From 037065fd211ad5232a2834bf7460b22b754d0a64 Mon Sep 17 00:00:00 2001 From: Adam Marcus Date: Sun, 15 Oct 2017 22:07:12 +0000 Subject: [PATCH] fix test --- orchestra/tests/test_dashboard.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/orchestra/tests/test_dashboard.py b/orchestra/tests/test_dashboard.py index 69df916ad..11548d900 100644 --- a/orchestra/tests/test_dashboard.py +++ b/orchestra/tests/test_dashboard.py @@ -130,11 +130,12 @@ def test_entry_level_task_assignment(self): def _check_client_dashboard_state(self, client, non_empty_status): response = client.get('/orchestra/api/interface/dashboard_tasks/') returned = load_encoded_json(response.content) - for status, val in returned['tasks'].items(): - if status == non_empty_status: - self.assertTrue(len(val) > 0) - else: - self.assertTrue(len(val) == 0) + non_empty_tasks = [task for task in returned['tasks'] + if task['state'] == non_empty_status] + empty_tasks = [task for task in returned['tasks'] + if task['state'] != non_empty_status] + self.assertGreater(len(non_empty_tasks), 0) + self.assertEqual(len(empty_tasks), 0) def test_reviewer_task_assignment(self): # there is a review task for user 1