diff --git a/tests/schema/tests.py b/tests/schema/tests.py
index b8ad08239b..90440ca734 100644
a
|
b
|
class SchemaTests(TransactionTestCase):
|
1980 | 1980 | # This fails if the unique index name isn't quoted. |
1981 | 1981 | editor.alter_unique_together(TagUniqueRename, [], (('title', 'slug2'),)) |
1982 | 1982 | finally: |
| 1983 | if TagUniqueRename._meta.db_table == 'unique-table': |
| 1984 | with connection.schema_editor() as editor: |
| 1985 | editor.delete_model(TagUniqueRename) |
1983 | 1986 | TagUniqueRename._meta.db_table = old_table_name |
1984 | 1987 | |
1985 | 1988 | @isolate_apps('schema') |
… |
… |
class SchemaTests(TransactionTestCase):
|
3236 | 3239 | def test_add_foreign_object(self): |
3237 | 3240 | with connection.schema_editor() as editor: |
3238 | 3241 | editor.create_model(BookForeignObj) |
3239 | | |
3240 | | new_field = ForeignObject(Author, on_delete=CASCADE, from_fields=['author_id'], to_fields=['id']) |
3241 | | new_field.set_attributes_from_name('author') |
3242 | | with connection.schema_editor() as editor: |
3243 | | editor.add_field(BookForeignObj, new_field) |
| 3242 | try: |
| 3243 | new_field = ForeignObject(Author, on_delete=CASCADE, from_fields=['author_id'], to_fields=['id']) |
| 3244 | new_field.set_attributes_from_name('author') |
| 3245 | with connection.schema_editor() as editor: |
| 3246 | editor.add_field(BookForeignObj, new_field) |
| 3247 | finally: |
| 3248 | # Clean up the table |
| 3249 | with connection.schema_editor() as editor: |
| 3250 | editor.delete_model(BookForeignObj) |
3244 | 3251 | |
3245 | 3252 | def test_creation_deletion_reserved_names(self): |
3246 | 3253 | """ |