From 10c0fe528a2089f4ba206caa50f9a98f8d9c8a15 Mon Sep 17 00:00:00 2001 From: Fabrizio Ettore Messina Date: Thu, 8 Mar 2018 16:56:55 +0100 Subject: Fixed #29178 -- Allowed Index.fields to accept a tuple. --- tests/model_indexes/tests.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/model_indexes/tests.py b/tests/model_indexes/tests.py index 28759dbe80..c75c8e8473 100644 --- a/tests/model_indexes/tests.py +++ b/tests/model_indexes/tests.py @@ -28,9 +28,12 @@ class IndexesTests(SimpleTestCase): self.assertNotEqual(index, another_index) def test_index_fields_type(self): - with self.assertRaisesMessage(ValueError, 'Index.fields must be a list.'): + with self.assertRaisesMessage(ValueError, 'Index.fields must be a list or tuple.'): models.Index(fields='title') + def test_fields_tuple(self): + self.assertEqual(models.Index(fields=('title',)).fields, ['title']) + def test_raises_error_without_field(self): msg = 'At least one field is required to define an index.' with self.assertRaisesMessage(ValueError, msg): -- cgit v1.3