From d389125606152a6cd57d0f6cadeddf0bd6232215 Mon Sep 17 00:00:00 2001 From: Claude Paroz Date: Sat, 20 Aug 2016 12:14:02 +0200 Subject: Fixed #27098 -- Deprecated DatabaseIntrospection.get_indexes Thanks Akshesh for help with the PostgreSQL query. Thanks Tim Graham for the review. --- tests/postgres_tests/test_array.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'tests/postgres_tests/test_array.py') diff --git a/tests/postgres_tests/test_array.py b/tests/postgres_tests/test_array.py index 2b5796dc6f..0b788e0d23 100644 --- a/tests/postgres_tests/test_array.py +++ b/tests/postgres_tests/test_array.py @@ -483,9 +483,13 @@ class TestMigrations(TransactionTestCase): ] # Only the CharField should have a LIKE index. self.assertEqual(like_constraint_columns_list, [['char2']]) - with connection.cursor() as cursor: - indexes = connection.introspection.get_indexes(cursor, table_name) # All fields should have regular indexes. + with connection.cursor() as cursor: + indexes = [ + c['columns'][0] + for c in connection.introspection.get_constraints(cursor, table_name).values() + if c['index'] and len(c['columns']) == 1 + ] self.assertIn('char', indexes) self.assertIn('char2', indexes) self.assertIn('text', indexes) -- cgit v1.3