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

Support unique field validation #91

Merged
merged 1 commit into from
Feb 7, 2022
Merged

Conversation

stevelacey
Copy link
Contributor

@stevelacey stevelacey commented Feb 3, 2022

Validate that unique fields are not being set to existing values, so that validation errors occur instead of db integrity errors.

Also refactors the tests and test client a bit, because duplicating tests for patch and put was getting tedious.

Note that this doesn't cater for unique_together, which would probably need custom validation anyway.

  • This PR increases test coverage to 83%

@stevelacey stevelacey force-pushed the improvement/unique-validation branch 2 times, most recently from 45face0 to 82578c9 Compare February 3, 2022 10:37
@stevelacey stevelacey force-pushed the improvement/unique-validation branch from 82578c9 to 9a996e7 Compare February 3, 2022 10:38
@stevelacey stevelacey changed the title Unique validation Support unique field validation Feb 3, 2022
@stevelacey stevelacey merged commit d6f67ab into master Feb 7, 2022
@stevelacey stevelacey deleted the improvement/unique-validation branch February 7, 2022 08:37
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.

1 participant