diff options
| author | Tim Graham <timograham@gmail.com> | 2016-01-22 10:55:31 -0500 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2016-01-22 12:46:27 -0500 |
| commit | b49cc8664306f8b44e9e12ebb9e43791d508ec74 (patch) | |
| tree | 863ea166bec3213bf0c2de9fd303cda63f0081a7 | |
| parent | bca9faae95db2a92e540fbd08505c134639916fe (diff) | |
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.
| -rw-r--r-- | tests/schema/tests.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/tests/schema/tests.py b/tests/schema/tests.py index dfd0659d34..ab95b0c79e 100644 --- a/tests/schema/tests.py +++ b/tests/schema/tests.py @@ -826,7 +826,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: @@ -834,6 +834,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): """ |
