diff options
| author | Claude Paroz <claude@2xlibre.net> | 2016-08-20 12:14:02 +0200 |
|---|---|---|
| committer | Claude Paroz <claude@2xlibre.net> | 2016-09-12 09:26:33 +0200 |
| commit | d389125606152a6cd57d0f6cadeddf0bd6232215 (patch) | |
| tree | 20f8b19adbcccf3b274136743efe3c596a86ffe7 /tests/postgres_tests/test_array.py | |
| parent | 1ec1633cb294d8ce2a65ece6b56c258483596fba (diff) | |
Fixed #27098 -- Deprecated DatabaseIntrospection.get_indexes
Thanks Akshesh <aksheshdoshi@gmail.com> for help with the PostgreSQL query.
Thanks Tim Graham for the review.
Diffstat (limited to 'tests/postgres_tests/test_array.py')
| -rw-r--r-- | tests/postgres_tests/test_array.py | 8 |
1 files changed, 6 insertions, 2 deletions
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) |
