From 225c413b08b3e034604ffbaed604a6867d7b712e Mon Sep 17 00:00:00 2001 From: Joseph Kocherhans Date: Wed, 10 Feb 2010 00:49:33 +0000 Subject: Fixed #12647. Allow unique_together checks be specified as lists as well as tuples. Thanks, Honza Král. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: http://code.djangoproject.com/svn/django/trunk@12403 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- tests/modeltests/validation/models.py | 2 +- tests/modeltests/validation/test_unique.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'tests') diff --git a/tests/modeltests/validation/models.py b/tests/modeltests/validation/models.py index 559658ef6d..dd42936885 100644 --- a/tests/modeltests/validation/models.py +++ b/tests/modeltests/validation/models.py @@ -36,7 +36,7 @@ class UniqueTogetherModel(models.Model): efield = models.EmailField() class Meta: - unique_together = (('ifield', 'cfield',), ('ifield', 'efield')) + unique_together = (('ifield', 'cfield',), ['ifield', 'efield']) class UniqueForDateModel(models.Model): start_date = models.DateField() diff --git a/tests/modeltests/validation/test_unique.py b/tests/modeltests/validation/test_unique.py index 2d67a0a296..ebda9abe77 100644 --- a/tests/modeltests/validation/test_unique.py +++ b/tests/modeltests/validation/test_unique.py @@ -13,7 +13,7 @@ class GetUniqueCheckTests(unittest.TestCase): m._get_unique_checks() ) - def test_unique_together_gets_picked_up(self): + def test_unique_together_gets_picked_up_and_converted_to_tuple(self): m = UniqueTogetherModel() self.assertEqual( ([('ifield', 'cfield',),('ifield', 'efield'), ('id',), ], []), -- cgit v1.3