TestUniqueConstraintValidation failing on foreign key field#9678
Closed
sipa-echo-zaoa wants to merge 0 commit intoencode:mainfrom
Closed
TestUniqueConstraintValidation failing on foreign key field#9678sipa-echo-zaoa wants to merge 0 commit intoencode:mainfrom
sipa-echo-zaoa wants to merge 0 commit intoencode:mainfrom
Conversation
browniebroke
reviewed
Apr 7, 2025
Comment on lines
520
to
524
| class UniqueConstraintModel(models.Model): | ||
| race_name = models.CharField(max_length=100) | ||
| position = models.IntegerField() | ||
| global_id = models.IntegerField() | ||
| fancy_conditions = models.IntegerField() |
Member
There was a problem hiding this comment.
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
Author
There was a problem hiding this comment.
Sure, I reverted the changes I made to the test and created another one covering the ForeignKey use case.
|
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. |
4920fd5 to
78db4dd
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.