diff options
author | Florian Apolloner <florian@apolloner.eu> | 2022-03-24 16:46:19 +0100 |
---|---|---|
committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2022-04-13 21:51:51 +0200 |
commit | 2eea361eff58dd98c409c5227064b901f41bd0d6 (patch) | |
tree | b551c3b45c3d0f133d88ef346ec1657f937d2892 /tests/backends | |
parent | 62ffc9883afdc0a9f9674702661062508230d7bf (diff) | |
download | django-2eea361eff58dd98c409c5227064b901f41bd0d6.tar.gz |
Fixed #30511 -- Used identity columns instead of serials on PostgreSQL.
Diffstat (limited to 'tests/backends')
-rw-r--r-- | tests/backends/postgresql/test_introspection.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/backends/postgresql/test_introspection.py b/tests/backends/postgresql/test_introspection.py index dc95d6ad23..2dfb7514d6 100644 --- a/tests/backends/postgresql/test_introspection.py +++ b/tests/backends/postgresql/test_introspection.py @@ -27,3 +27,18 @@ class DatabaseSequenceTests(TestCase): seqs, [{"table": Person._meta.db_table, "column": "id", "name": "pers_seq"}], ) + + def test_get_sequences_old_serial(self): + with connection.cursor() as cursor: + cursor.execute("CREATE TABLE testing (serial_field SERIAL);") + seqs = connection.introspection.get_sequences(cursor, "testing") + self.assertEqual( + seqs, + [ + { + "table": "testing", + "column": "serial_field", + "name": "testing_serial_field_seq", + } + ], + ) |