summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorTim Graham <timograham@gmail.com>2020-08-22 14:32:01 -0400
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2020-08-24 14:32:07 +0200
commitea880ec233ecd61c20b74eb7d6d1cf1223897179 (patch)
tree622df7f048970ed97fec1ce67781059039563535 /tests
parentb3124215117541a86b0740314ef991e1d521da69 (diff)
Fixed #24533 -- Dropped PostgreSQL sequence and Oracle identity when migrating away from AutoField.
Diffstat (limited to 'tests')
-rw-r--r--tests/schema/tests.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/schema/tests.py b/tests/schema/tests.py
index e516b17b59..8e992b4917 100644
--- a/tests/schema/tests.py
+++ b/tests/schema/tests.py
@@ -677,6 +677,11 @@ class SchemaTests(TransactionTestCase):
new_field.model = Author
with connection.schema_editor() as editor:
editor.alter_field(Author, old_field, new_field, strict=True)
+ # Now that ID is an IntegerField, the database raises an error if it
+ # isn't provided.
+ if not connection.features.supports_unspecified_pk:
+ with self.assertRaises(DatabaseError):
+ Author.objects.create()
def test_alter_auto_field_to_char_field(self):
# Create the table