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

TestUniqueConstraintValidation failing on foreign key field #9678

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

Conversation

sipa-echo-zaoa
Copy link

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.

class UniqueConstraintModel(models.Model):
race_name = models.CharField(max_length=100)
position = models.IntegerField()
global_id = models.IntegerField()
fancy_conditions = models.IntegerField()
Copy link
Member

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

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