From c77e73b26f5b7633dd12c1ad5db0529101302f35 Mon Sep 17 00:00:00 2001 From: Katie Smith Date: Tue, 16 Feb 2021 13:50:07 +0000 Subject: [PATCH] Fix failing test This was passing locally, but failing on Concourse due to a different order of TemplateHistory items being returned. This changes the test so that it can't randomly fail based on the order of template history items returned. --- tests/app/template/test_rest.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/tests/app/template/test_rest.py b/tests/app/template/test_rest.py index 36a1ddd8d..9096ed95d 100644 --- a/tests/app/template/test_rest.py +++ b/tests/app/template/test_rest.py @@ -377,12 +377,10 @@ def test_update_should_update_a_template(client, sample_user): assert update_json_resp['data']['version'] == 2 assert update_json_resp['data']['created_by'] == str(sample_user.id) - assert [ - template.created_by_id for template in TemplateHistory.query.all() - ] == [ - service.created_by.id, - sample_user.id, - ] + template_created_by_users = [template.created_by_id for template in TemplateHistory.query.all()] + assert len(template_created_by_users) == 2 + assert service.created_by.id in template_created_by_users + assert sample_user.id in template_created_by_users def test_should_be_able_to_archive_template(client, sample_template):