mirror of
https://github.com/django/django.git
synced 2025-01-26 10:09:42 +00:00
Remove most errors when running migration tests twice
This commit is contained in:
parent
fe9f342d8c
commit
f671fb9d11
@ -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",
|
||||
|
Loading…
x
Reference in New Issue
Block a user