summaryrefslogtreecommitdiff
path: root/tests/modeltests/validation/test_unique.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/modeltests/validation/test_unique.py')
-rw-r--r--tests/modeltests/validation/test_unique.py9
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.