#30581: Allow constraints to be used for validation (in Python) -------------------------------------+------------------------------------- Reporter: Carlton Gibson | Owner: Gagaro Type: New feature | Status: closed Component: Database layer | Version: 4.0 (models, ORM) | Severity: Normal | Resolution: fixed Keywords: constraints, | Triage Stage: Ready for validation | checkin Has patch: 1 | Needs documentation: 0 Needs tests: 0 | Patch needs improvement: 0 Easy pickings: 0 | UI/UX: 0 -------------------------------------+------------------------------------- Comment (by Sarah Boyce <42296566+sarahboyce@…>):
In [changeset:"c30669821bcda112647af4ebf5b09d3607672909" c3066982]: {{{#!CommitTicketReference repository="" revision="c30669821bcda112647af4ebf5b09d3607672909" [5.0.x] Refs #30581 -- Made unattached UniqueConstraint(fields) validation testable. The logic allowing UniqueConstraint(fields).validate to preserve backward compatiblity with Model.unique_error_message failed to account for cases where the constraint might not be attached to a model which is a common pattern during testing. This changes allows for arbitrary UniqueConstraint(fields) to be tested in isolation without requiring actual models backing them up. Co-authored-by: Mark G <mark.gens...@protonmail.com> Backport of 13922580cccfb9ab2922ff4943dd39da56dfbd8c from main. }}} -- Ticket URL: <https://code.djangoproject.com/ticket/30581#comment:31> Django <https://code.djangoproject.com/> The Web framework for perfectionists with deadlines. -- You received this message because you are subscribed to the Google Groups "Django updates" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-updates+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/01070190c062342e-7c8b783e-d67e-4c6d-9dd1-925f7b739af5-000000%40eu-central-1.amazonses.com.