Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix unique key violation error in tests #455

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

pxwxnvermx
Copy link
Contributor

This PR fixes the unique key violation error that randomly occurs in the CI test runner. Using the django_get_or_create meta option for OpportunityAccessFactory, we can specify to run the get_or_create method to create objects when certain fields are present, in this case, user and opportunity. This will help avoid creating duplicate OpportunityAccess for users.

Failing CI Run and Test Description

@calellowitz
Copy link
Collaborator

Do you know how this happens? I would expect tests clean up state and new invocations to always have unique values. Generally we would probably want to know if tests were reusing objects or not, so I would prefer if we could figure out how those are getting repeated, although this is probably a fine change

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants