summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Godwin <andrew@aeracode.org>2013-09-25 16:11:05 +0100
committerAndrew Godwin <andrew@aeracode.org>2013-09-25 16:11:05 +0100
commitf671fb9d1182afd15d471bf05639052cc8a7cde7 (patch)
treef71adc989a1a77a8ec1a82eaaedcee6a022a69b3
parentfe9f342d8ceae96a03295e56ec743ed2e2e5fb51 (diff)
Remove most errors when running migration tests twice
-rw-r--r--tests/migrations/test_operations.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/migrations/test_operations.py b/tests/migrations/test_operations.py
index db79e730e2..723f1ce741 100644
--- a/tests/migrations/test_operations.py
+++ b/tests/migrations/test_operations.py
@@ -16,6 +16,16 @@ class OperationTests(MigrationTestBase):
"""
Creates a test model state and database table.
"""
+ # Delete the tables if they already exist
+ cursor = connection.cursor()
+ try:
+ cursor.execute("DROP TABLE %s_pony" % app_label)
+ except:
+ pass
+ try:
+ cursor.execute("DROP TABLE %s_stable" % app_label)
+ except:
+ pass
# Make the "current" state
operations = [migrations.CreateModel(
"Pony",