Commit e2a3be1e authored by Shai Berger's avatar Shai Berger
Browse files

[1.8.x] Fixed #24362: Made test run each migration operation in its own schema editor

Thanks Tim Graham for pointing out the fix.

Backport of f7d34fe7 from master ticket_24362
parent 84c9b24c
Loading
Loading
Loading
Loading
+9 −6
Original line number Diff line number Diff line
@@ -1702,14 +1702,17 @@ class OperationTests(OperationTestBase):
            create_author.database_forwards("test_authors", editor, project_state, new_state)
        project_state = new_state
        new_state = new_state.clone()
        with connection.schema_editor() as editor:
            create_book.state_forwards("test_books", new_state)
            create_book.database_forwards("test_books", editor, project_state, new_state)
        project_state = new_state
        new_state = new_state.clone()
        with connection.schema_editor() as editor:
            add_hometown.state_forwards("test_authors", new_state)
            add_hometown.database_forwards("test_authors", editor, project_state, new_state)
        project_state = new_state
        new_state = new_state.clone()
        with connection.schema_editor() as editor:
            create_old_man.state_forwards("test_books", new_state)
            create_old_man.database_forwards("test_books", editor, project_state, new_state)