Skip to content

Commit

Permalink
fix: use reseed to prevent conflict and get arbitrary usernames
Browse files Browse the repository at this point in the history
  • Loading branch information
sirtawast committed Nov 16, 2023
1 parent cfd7e8b commit 77962ed
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -102,30 +102,32 @@ def _get_csv_pdf_zip(handler_api_client: APIClient, url: str) -> ZipFile:


def _create_applications_for_export():
reseed(1)
application1 = DecidedApplicationFactory(status=ApplicationStatus.ACCEPTED)
application1.log_entries.filter(to_status=ApplicationStatus.ACCEPTED).update(
created_at=datetime(2022, 1, 1, tzinfo=timezone.utc)
)
reseed(2)
application2 = DecidedApplicationFactory(status=ApplicationStatus.ACCEPTED)
application2.log_entries.filter(to_status=ApplicationStatus.ACCEPTED).update(
created_at=datetime(2022, 2, 1, tzinfo=timezone.utc)
)
reseed(3)
application3 = DecidedApplicationFactory(status=ApplicationStatus.REJECTED)
application3.log_entries.filter(to_status=ApplicationStatus.REJECTED).update(
created_at=datetime(2022, 3, 1, tzinfo=timezone.utc)
)
reseed(4)
application4 = DecidedApplicationFactory(
status=ApplicationStatus.HANDLING
) # should be excluded
application4.log_entries.filter(to_status=ApplicationStatus.HANDLING).update(
created_at=datetime(2022, 2, 1, tzinfo=timezone.utc)
)
reseed(777)
return (application1, application2, application3, application4)


# @pytest.mark.skip(
# reason="This test fails in deploy pipeline - DETAIL: Key (username)=(masonzachary_a45eb8) already exists."
# )
def test_applications_csv_export_new_applications(handler_api_client):
(
application1,
Expand Down

0 comments on commit 77962ed

Please sign in to comment.