Kaydet (Commit) f671fb9d authored tarafından Andrew Godwin's avatar Andrew Godwin

Remove most errors when running migration tests twice

üst fe9f342d
......@@ -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",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment