#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:"a2791f5ea2cb3bfa5b386083002461be40708297" a2791f5e]:
 {{{#!CommitTicketReference repository=""
 revision="a2791f5ea2cb3bfa5b386083002461be40708297"
 [5.1.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:30>
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/01070190c0575ff5-7e51e41a-09bf-4d58-beda-ba12255717a7-000000%40eu-central-1.amazonses.com.

Reply via email to