diff options
| author | Shai Berger <shai@platonix.com> | 2015-02-18 22:44:31 +0200 |
|---|---|---|
| committer | Shai Berger <shai@platonix.com> | 2015-02-18 22:47:15 +0200 |
| commit | f7d34fe741ea64f3ec89f1d742d47182065e2c2a (patch) | |
| tree | 4cfbeef625e2ba909316759cc050e0bcab4fed66 /tests | |
| parent | 15dc8d1c9d3697170a2c59ecaa7a2b4ba58f5990 (diff) | |
Fixed #24362: Made test run each migration operation in its own schema editor
Thanks Tim Graham for pointing out the fix.
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/migrations/test_operations.py | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/tests/migrations/test_operations.py b/tests/migrations/test_operations.py index 05e0e535f1..acbd389bce 100644 --- a/tests/migrations/test_operations.py +++ b/tests/migrations/test_operations.py @@ -1700,16 +1700,19 @@ class OperationTests(OperationTestBase): with connection.schema_editor() as editor: create_author.state_forwards("test_authors", new_state) create_author.database_forwards("test_authors", editor, project_state, new_state) - project_state = new_state - new_state = new_state.clone() + 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() + 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() + 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) |
