mirror of
https://github.com/django/django.git
synced 2025-08-03 18:38:50 +00:00
Refs #33476 -- Reformatted code with Black.
This commit is contained in:
parent
f68fa8b45d
commit
9c19aff7c7
1992 changed files with 139577 additions and 96284 deletions
|
@ -6,18 +6,24 @@ from django.test import TestCase
|
|||
from ..models import Person
|
||||
|
||||
|
||||
@unittest.skipUnless(connection.vendor == 'postgresql', "Test only for PostgreSQL")
|
||||
@unittest.skipUnless(connection.vendor == "postgresql", "Test only for PostgreSQL")
|
||||
class DatabaseSequenceTests(TestCase):
|
||||
def test_get_sequences(self):
|
||||
with connection.cursor() as cursor:
|
||||
seqs = connection.introspection.get_sequences(cursor, Person._meta.db_table)
|
||||
self.assertEqual(
|
||||
seqs,
|
||||
[{'table': Person._meta.db_table, 'column': 'id', 'name': 'backends_person_id_seq'}]
|
||||
[
|
||||
{
|
||||
"table": Person._meta.db_table,
|
||||
"column": "id",
|
||||
"name": "backends_person_id_seq",
|
||||
}
|
||||
],
|
||||
)
|
||||
cursor.execute('ALTER SEQUENCE backends_person_id_seq RENAME TO pers_seq')
|
||||
cursor.execute("ALTER SEQUENCE backends_person_id_seq RENAME TO pers_seq")
|
||||
seqs = connection.introspection.get_sequences(cursor, Person._meta.db_table)
|
||||
self.assertEqual(
|
||||
seqs,
|
||||
[{'table': Person._meta.db_table, 'column': 'id', 'name': 'pers_seq'}]
|
||||
[{"table": Person._meta.db_table, "column": "id", "name": "pers_seq"}],
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue