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

Refs #27090 -- Added real database sequence introspection.

Thanks Mariusz Felisiak for the Oracle part and Tim Graham for the
review.
This commit is contained in:
Mariusz Felisiak
2017-09-13 20:12:32 +02:00
committed by GitHub
parent c2ecef869c
commit c6a1faecc3
9 changed files with 131 additions and 10 deletions

View File

@@ -61,8 +61,9 @@ class IntrospectionTests(TransactionTestCase):
def test_sequence_list(self):
sequences = connection.introspection.sequence_list()
expected = {'table': Reporter._meta.db_table, 'column': 'id'}
self.assertIn(expected, sequences, 'Reporter sequence not found in sequence_list()')
reporter_seqs = [seq for seq in sequences if seq['table'] == Reporter._meta.db_table]
self.assertEqual(len(reporter_seqs), 1, 'Reporter sequence not found in sequence_list()')
self.assertEqual(reporter_seqs[0]['column'], 'id')
def test_get_table_description_names(self):
with connection.cursor() as cursor: