diff --git a/backend/benefit/applications/tests/test_ahjo_integration.py b/backend/benefit/applications/tests/test_ahjo_integration.py index e8234876ea..c471621b54 100644 --- a/backend/benefit/applications/tests/test_ahjo_integration.py +++ b/backend/benefit/applications/tests/test_ahjo_integration.py @@ -38,6 +38,7 @@ from applications.tests.factories import ApplicationFactory, DecidedApplicationFactory from calculator.models import Calculation from calculator.tests.factories import PaySubsidyFactory +from common.tests.conftest import reseed from common.utils import hash_file from companies.tests.factories import CompanyFactory from helsinkibenefit.tests.conftest import * # noqa @@ -216,16 +217,22 @@ def test_generate_composed_template_html(mock_pdf_convert): ) +# Test flaking if no reseed is used def test_export_application_batch(application_batch): + reseed(12345) application_batch.applications.add( DecidedApplicationFactory.create( status=ApplicationStatus.ACCEPTED, calculation__calculated_benefit_amount=1000, ) ) + + reseed(23456) application_batch.applications.add( DecidedApplicationFactory.create(status=ApplicationStatus.REJECTED) ) + + reseed(34567) application_batch.applications.add( DecidedApplicationFactory.create(status=ApplicationStatus.CANCELLED) ) @@ -239,6 +246,7 @@ def test_export_application_batch(application_batch): ).count() + 4 ) + reseed(777) @patch("applications.services.ahjo_integration.pdfkit.from_string")