mirror of
https://github.com/django/django.git
synced 2025-08-03 10:34:04 +00:00
Fixed #27097 -- Added index type introspection to built-in db backends.
This commit is contained in:
parent
082f5bfdbc
commit
dbccf163b6
8 changed files with 23 additions and 20 deletions
|
@ -184,13 +184,14 @@ class IntrospectionTests(TransactionTestCase):
|
|||
self.assertNotIn('first_name', indexes)
|
||||
self.assertIn('id', indexes)
|
||||
|
||||
@skipUnlessDBFeature('can_introspect_index_type')
|
||||
def test_get_constraints_index_types(self):
|
||||
with connection.cursor() as cursor:
|
||||
constraints = connection.introspection.get_constraints(cursor, Article._meta.db_table)
|
||||
index = {}
|
||||
for key, val in constraints.items():
|
||||
if val['index'] and not (val['primary_key'] or val['unique']):
|
||||
self.assertEqual(val['type'], 'btree')
|
||||
if val['columns'] == ['headline', 'pub_date']:
|
||||
index = val
|
||||
self.assertEqual(index['type'], 'btree')
|
||||
|
||||
@skipUnlessDBFeature('supports_index_column_ordering')
|
||||
def test_get_constraints_indexes_orders(self):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue