summaryrefslogtreecommitdiff
path: root/tests/introspection
diff options
context:
space:
mode:
authorAkshesh <aksheshdoshi@gmail.com>2016-08-08 10:29:08 +0530
committerTim Graham <timograham@gmail.com>2016-08-12 16:58:40 -0400
commit2f19306a125a9253d99b35b276d932e8e24d4e6f (patch)
tree6c505535f15218b2ea0fd57e7d4ae97976662daa /tests/introspection
parent72d541b61cd7b0a14f70242e2207fdb3f600c4d5 (diff)
Refs #27030 -- Added index type introspection on PostgreSQL.
Diffstat (limited to 'tests/introspection')
-rw-r--r--tests/introspection/tests.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/introspection/tests.py b/tests/introspection/tests.py
index 31b0214704..f01f81e718 100644
--- a/tests/introspection/tests.py
+++ b/tests/introspection/tests.py
@@ -170,6 +170,11 @@ class IntrospectionTests(TransactionTestCase):
def test_get_indexes(self):
with connection.cursor() as cursor:
indexes = connection.introspection.get_indexes(cursor, Article._meta.db_table)
+ if connection.features.can_introspect_index_type:
+ index_type = indexes['reporter_id'].pop('type', None)
+ self.assertIsNotNone(index_type)
+ if connection.vendor == 'postgresql':
+ self.assertEqual(index_type, 'btree')
self.assertEqual(indexes['reporter_id'], {'unique': False, 'primary_key': False})
def test_get_indexes_multicol(self):