-
Notifications
You must be signed in to change notification settings - Fork 395
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
bug with django 4.1 #972
Comments
The package introduced support for django 4.1 but it was not published yet. |
See #914. |
The step to reproduce lack details. For example, we see in the stack trace that Shot in the dark: did you override the Lines 115 to 120 in 8e5b79a
|
@francoisfreitag Hi, |
May be the same issue as #979. |
I get the same issue when going from Django 3.2.16 to 4.0.8, with factory_boy 3.2.1. |
I have found the reason why I see this. Django 3.2 allows accessing foreign keys before an object is saved for the first time. Django 4.0 does not. I worked around this by saving twice in Example:
|
@hishamkaram @hmpf is there any chance your problem is solved with #981 Perhaps you can run you code against that branch? |
@francoisfreitag _original_params errors disappeared but still getting this UniqueViolation error. I don’t pass any id, I am just using create_batch and SubFactory in several test cases
|
It looks like an issue with your factory. |
@francoisfreitag actually there is no |
Does your database have an autoincrement for |
@francoisfreitag @foarsitter true, thank you so much. i think this branch fixed the issue |
Thanks for testing and your feedback @hishamkaram! |
Description
we are using factory boy with django unit test but when we upgraded from 4.0.4 to 4.1.1
i got the following errors
To Reproduce
Share how the bug happened:
Model / Factory code
The issue
this factory is used everywhere in the project, not sure why this error appeared after upgrading to django 4.1.1
The text was updated successfully, but these errors were encountered: