1
0
mirror of https://github.com/django/django.git synced 2025-10-23 21:59:11 +00:00

Refs #27030 -- Added index type introspection on PostgreSQL.

This commit is contained in:
Akshesh
2016-08-08 10:29:08 +05:30
committed by Tim Graham
parent 72d541b61c
commit 2f19306a12
5 changed files with 21 additions and 6 deletions

View File

@@ -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):