summaryrefslogtreecommitdiff
path: root/tests/postgres_tests/test_array.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/postgres_tests/test_array.py')
-rw-r--r--tests/postgres_tests/test_array.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/postgres_tests/test_array.py b/tests/postgres_tests/test_array.py
index 379a1e9bba..7b7793f6c1 100644
--- a/tests/postgres_tests/test_array.py
+++ b/tests/postgres_tests/test_array.py
@@ -592,6 +592,20 @@ class TestChecks(PostgreSQLSimpleTestCase):
self.assertEqual(errors[0].id, 'postgres.E001')
self.assertIn('max_length', errors[0].msg)
+ def test_choices_tuple_list(self):
+ class MyModel(PostgreSQLModel):
+ field = ArrayField(
+ models.CharField(max_length=16),
+ choices=[
+ [
+ 'Media',
+ [(['vinyl', 'cd'], 'Audio'), (('vhs', 'dvd'), 'Video')],
+ ],
+ (['mp3', 'mp4'], 'Digital'),
+ ],
+ )
+ self.assertEqual(MyModel._meta.get_field('field').check(), [])
+
@unittest.skipUnless(connection.vendor == 'postgresql', "PostgreSQL specific tests")
class TestMigrations(TransactionTestCase):