diff options
| author | Russell Keith-Magee <russell@keith-magee.com> | 2010-08-17 07:07:28 +0000 |
|---|---|---|
| committer | Russell Keith-Magee <russell@keith-magee.com> | 2010-08-17 07:07:28 +0000 |
| commit | 015d85aee64ed8b020c38b2ada55d8aaba0608eb (patch) | |
| tree | b302847c4b5dbcf17ba69d8c6058d8538121e56f /tests/modeltests/validation/test_unique.py | |
| parent | 810ed2b22be663660d2ad56a43357c9a0378d7df (diff) | |
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
Diffstat (limited to 'tests/modeltests/validation/test_unique.py')
| -rw-r--r-- | tests/modeltests/validation/test_unique.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/modeltests/validation/test_unique.py b/tests/modeltests/validation/test_unique.py index 1b966390c4..fb77c4d28c 100644 --- a/tests/modeltests/validation/test_unique.py +++ b/tests/modeltests/validation/test_unique.py @@ -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. |
