mirror of
https://github.com/django/django.git
synced 2025-08-04 02:48:35 +00:00
Fixed #28386 -- Made operations within non-atomic migrations honor the operation's atomic flag when migrating backwards.
This commit is contained in:
parent
5893eaddf4
commit
7937cc16f5
5 changed files with 16 additions and 3 deletions
|
@ -2055,9 +2055,11 @@ class OperationTests(OperationTestBase):
|
|||
with self.assertRaises(ValueError):
|
||||
with connection.schema_editor() as editor:
|
||||
atomic_migration.unapply(project_state, editor)
|
||||
self.assertEqual(project_state.apps.get_model("test_runpythonatomic", "Pony").objects.count(), 0)
|
||||
with self.assertRaises(ValueError):
|
||||
with connection.schema_editor() as editor:
|
||||
non_atomic_migration.unapply(project_state, editor)
|
||||
self.assertEqual(project_state.apps.get_model("test_runpythonatomic", "Pony").objects.count(), 1)
|
||||
# Verify deconstruction.
|
||||
definition = non_atomic_migration.operations[0].deconstruct()
|
||||
self.assertEqual(definition[0], "RunPython")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue