Ticket #12647: 12647.dif

File 12647.dif, 1.6 KB (added by Honza Král, 15 years ago)
Line 
1diff --git a/django/db/models/base.py b/django/db/models/base.py
2index dc4b8f0..449c41a 100644
3--- a/django/db/models/base.py
4+++ b/django/db/models/base.py
5@@ -683,7 +683,7 @@ class Model(object):
6 if name in exclude:
7 break
8 else:
9- unique_checks.append(check)
10+ unique_checks.append(tuple(check))
11
12 # These are checks for the unique_for_<date/year/month>.
13 date_checks = []
14diff --git a/tests/modeltests/validation/models.py b/tests/modeltests/validation/models.py
15index 43a5f5f..517c963 100644
16--- a/tests/modeltests/validation/models.py
17+++ b/tests/modeltests/validation/models.py
18@@ -36,7 +36,7 @@ class UniqueTogetherModel(models.Model):
19 efield = models.EmailField()
20
21 class Meta:
22- unique_together = (('ifield', 'cfield',), ('ifield', 'efield'))
23+ unique_together = (('ifield', 'cfield',), ['ifield', 'efield'])
24
25 class UniqueForDateModel(models.Model):
26 start_date = models.DateField()
27diff --git a/tests/modeltests/validation/test_unique.py b/tests/modeltests/validation/test_unique.py
28index 2d67a0a..ebda9ab 100644
29--- a/tests/modeltests/validation/test_unique.py
30+++ b/tests/modeltests/validation/test_unique.py
31@@ -13,7 +13,7 @@ class GetUniqueCheckTests(unittest.TestCase):
32 m._get_unique_checks()
33 )
34
35- def test_unique_together_gets_picked_up(self):
36+ def test_unique_together_gets_picked_up_and_converted_to_tuple(self):
37 m = UniqueTogetherModel()
38 self.assertEqual(
39 ([('ifield', 'cfield',),('ifield', 'efield'), ('id',), ], []),
Back to Top