mirror of
https://github.com/django/django.git
synced 2025-09-26 12:09:19 +00:00
Fixed #14102 -- Ensure that fields that have been excluded from a form aren't included in the unique_for_* checks, either. Thanks to Travis Cline for the report and fix.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@13598 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
810ed2b22b
commit
015d85aee6
4 changed files with 18 additions and 5 deletions
|
@ -40,6 +40,15 @@ class GetUniqueCheckTests(unittest.TestCase):
|
|||
), m._get_unique_checks()
|
||||
)
|
||||
|
||||
def test_unique_for_date_exclusion(self):
|
||||
m = UniqueForDateModel()
|
||||
self.assertEqual((
|
||||
[(UniqueForDateModel, ('id',))],
|
||||
[(UniqueForDateModel, 'year', 'count', 'end_date'),
|
||||
(UniqueForDateModel, 'month', 'order', 'end_date')]
|
||||
), m._get_unique_checks(exclude='start_date')
|
||||
)
|
||||
|
||||
class PerformUniqueChecksTest(unittest.TestCase):
|
||||
def setUp(self):
|
||||
# Set debug to True to gain access to connection.queries.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue