mirror of
https://github.com/django/django.git
synced 2025-01-03 15:06:09 +00:00
Fixed isolation of test_rename_table_renames_deferred_sql_references().
This commit is contained in:
parent
0aacbdcf27
commit
af609c2f4d
@ -3817,10 +3817,14 @@ class SchemaTests(TransactionTestCase):
|
|||||||
editor.create_model(Book)
|
editor.create_model(Book)
|
||||||
editor.alter_db_table(Author, 'schema_author', 'schema_renamed_author')
|
editor.alter_db_table(Author, 'schema_author', 'schema_renamed_author')
|
||||||
editor.alter_db_table(Author, 'schema_book', 'schema_renamed_book')
|
editor.alter_db_table(Author, 'schema_book', 'schema_renamed_book')
|
||||||
self.assertGreater(len(editor.deferred_sql), 0)
|
try:
|
||||||
for statement in editor.deferred_sql:
|
self.assertGreater(len(editor.deferred_sql), 0)
|
||||||
self.assertIs(statement.references_table('schema_author'), False)
|
for statement in editor.deferred_sql:
|
||||||
self.assertIs(statement.references_table('schema_book'), False)
|
self.assertIs(statement.references_table('schema_author'), False)
|
||||||
|
self.assertIs(statement.references_table('schema_book'), False)
|
||||||
|
finally:
|
||||||
|
editor.alter_db_table(Author, 'schema_renamed_author', 'schema_author')
|
||||||
|
editor.alter_db_table(Author, 'schema_renamed_book', 'schema_book')
|
||||||
|
|
||||||
def test_rename_column_renames_deferred_sql_references(self):
|
def test_rename_column_renames_deferred_sql_references(self):
|
||||||
with connection.schema_editor() as editor:
|
with connection.schema_editor() as editor:
|
||||||
|
Loading…
Reference in New Issue
Block a user