From 02c049ab1ab5273d4212890635f94cc7eac7b158 Mon Sep 17 00:00:00 2001 From: Shai Berger Date: Thu, 10 Dec 2015 02:12:04 +0200 Subject: [PATCH] [1.8.x] Refs #25896 -- Fixed migration test failure on Oracle The test creates and deletes a model in the same migration, and the model had an AutoField. On Oracle, AutoField's are set up using deferred SQL, which in this case was trying to modify a table after it had dbeen removed. Backport of c8b3fbe from master --- tests/migrations/test_operations.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/migrations/test_operations.py b/tests/migrations/test_operations.py index db2f82675a..9849f66882 100644 --- a/tests/migrations/test_operations.py +++ b/tests/migrations/test_operations.py @@ -1852,7 +1852,10 @@ class OperationTests(OperationTestBase): ), migrations.CreateModel( "ILoveMorePonies", - [("id", models.AutoField(primary_key=True))], + # We use IntegerField and not AutoField because + # the model is going to be deleted immediately + # and with an AutoField this fails on Oracle + [("id", models.IntegerField(primary_key=True))], options={"db_table": "ilovemoreponies"}, ), migrations.DeleteModel("ILoveMorePonies"),