From ca5a79df8c70fcd49f449f6d612b6455ca9fc50f Mon Sep 17 00:00:00 2001 From: Armin Samii Date: Fri, 1 Nov 2024 19:56:00 -0400 Subject: [PATCH] fix flaky test --- electionpage/tests.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/electionpage/tests.py b/electionpage/tests.py index 598a6fc9..3e9bf021 100644 --- a/electionpage/tests.py +++ b/electionpage/tests.py @@ -304,8 +304,9 @@ def test_are_results_certified_initializes_correctly(self): # Wait for the object to be loaded self._ensure_eventually_asserts( - ScrapableElectionPage.objects.filter(slug='cuteslug').exists - ) + lambda: self.assertTrue( + ScrapableElectionPage.objects.filter( + slug='cuteslug').exists())) # Then ensure all scrapers have areResultsCertified scrapableElectionPage = ScrapableElectionPage.objects.get(slug='cuteslug')