Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
sipa-echo-zaoa wants to merge3 commits intoencode:master
base:master
Choose a base branch
Loading
fromsipa-echo-zaoa:master

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@browniebrokecomment.

browniebroke reacted with hooray emoji9128305 reacted with eyes emoji
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 newForeignKey use case. Would avoid a potential fix breaking a behaviour with non-foreign key fields. Thanks

auvipy reacted with thumbs up emoji

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.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Thank you 🙌🏻

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@browniebrokebrowniebrokebrowniebroke left review comments

At least 1 approving review is required to merge this pull request.

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@sipa-echo-zaoa@browniebroke

[8]ページ先頭

©2009-2025 Movatter.jp