Fixed #24362: Made test run each migration operation in its own schema editor
Thanks Tim Graham for pointing out the fix.
This commit is contained in:
parent
15dc8d1c9d
commit
f7d34fe741
|
@ -1700,16 +1700,19 @@ class OperationTests(OperationTestBase):
|
||||||
with connection.schema_editor() as editor:
|
with connection.schema_editor() as editor:
|
||||||
create_author.state_forwards("test_authors", new_state)
|
create_author.state_forwards("test_authors", new_state)
|
||||||
create_author.database_forwards("test_authors", editor, project_state, new_state)
|
create_author.database_forwards("test_authors", editor, project_state, new_state)
|
||||||
project_state = new_state
|
project_state = new_state
|
||||||
new_state = new_state.clone()
|
new_state = new_state.clone()
|
||||||
|
with connection.schema_editor() as editor:
|
||||||
create_book.state_forwards("test_books", new_state)
|
create_book.state_forwards("test_books", new_state)
|
||||||
create_book.database_forwards("test_books", editor, project_state, new_state)
|
create_book.database_forwards("test_books", editor, project_state, new_state)
|
||||||
project_state = new_state
|
project_state = new_state
|
||||||
new_state = new_state.clone()
|
new_state = new_state.clone()
|
||||||
|
with connection.schema_editor() as editor:
|
||||||
add_hometown.state_forwards("test_authors", new_state)
|
add_hometown.state_forwards("test_authors", new_state)
|
||||||
add_hometown.database_forwards("test_authors", editor, project_state, new_state)
|
add_hometown.database_forwards("test_authors", editor, project_state, new_state)
|
||||||
project_state = new_state
|
project_state = new_state
|
||||||
new_state = new_state.clone()
|
new_state = new_state.clone()
|
||||||
|
with connection.schema_editor() as editor:
|
||||||
create_old_man.state_forwards("test_books", new_state)
|
create_old_man.state_forwards("test_books", new_state)
|
||||||
create_old_man.database_forwards("test_books", editor, project_state, new_state)
|
create_old_man.database_forwards("test_books", editor, project_state, new_state)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue