summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorTim Graham <timograham@gmail.com>2016-01-22 10:55:31 -0500
committerTim Graham <timograham@gmail.com>2016-01-22 13:08:50 -0500
commit6919586bcd87089d37cb95367eea39b63ec697e9 (patch)
tree06a11e5106e81e254659b6d7a2048fdee6415e1a /tests
parent009c697312d85143157095f65f738ddd6c257ec4 (diff)
[1.8.x] Fixed #26116 -- Corrected schema's test_alter_implicit_id_to_explicit.
AUTOINCREMENT is dropped converting an AutoField to IntegerField which isn't the point of this test. MySQL would warn or error about this. Backport of b49cc8664306f8b44e9e12ebb9e43791d508ec74 from master
Diffstat (limited to 'tests')
-rw-r--r--tests/schema/tests.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/tests/schema/tests.py b/tests/schema/tests.py
index c5aa0927ad..439a59f0f9 100644
--- a/tests/schema/tests.py
+++ b/tests/schema/tests.py
@@ -722,7 +722,7 @@ class SchemaTests(TransactionTestCase):
editor.create_model(Author)
old_field = Author._meta.get_field("id")
- new_field = IntegerField(primary_key=True)
+ new_field = AutoField(primary_key=True)
new_field.set_attributes_from_name("id")
new_field.model = Author
with connection.schema_editor() as editor:
@@ -730,6 +730,7 @@ class SchemaTests(TransactionTestCase):
# This will fail if DROP DEFAULT is inadvertently executed on this
# field which drops the id sequence, at least on PostgreSQL.
Author.objects.create(name='Foo')
+ Author.objects.create(name='Bar')
def test_alter_int_pk_to_autofield_pk(self):
"""