-
-
Notifications
You must be signed in to change notification settings - Fork 7k
TestUniqueConstraintValidation failing on foreign key field #9678
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
base: main
Are you sure you want to change the base?
Conversation
| class UniqueConstraintModel(models.Model): | ||
| race_name = models.CharField(max_length=100) | ||
| position = models.IntegerField() | ||
| global_id = models.IntegerField() | ||
| fancy_conditions = models.IntegerField() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would you mind keeping this model as it was and add a new model to cover the new ForeignKey use case. Would avoid a potential fix breaking a behaviour with non-foreign key fields. Thanks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, I reverted the changes I made to the test and created another one covering the ForeignKey use case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you 🙌🏻
|
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Description
This merge request contains the changes to the TestUniqueConstraintValidation test case to reproduce the problem where the constraints are not being applied if the field is a foreign key as request by @browniebroke comment.