mirror of
https://github.com/django/django.git
synced 2025-08-03 10:34:04 +00:00
Fixed #27731 -- Implemented CreateModel/AlterFooOperation reduction.
This should alleviate the side effects of disabling the AlterFooOperation reduction with RemoveField to fix refs #28862 during migration squashing because CreateModel can perform a reduction with RemoveField. Thanks Nick Pope for the review.
This commit is contained in:
parent
ed7898e1b5
commit
8e3f22f251
4 changed files with 95 additions and 20 deletions
|
@ -2075,8 +2075,10 @@ class AutodetectorTests(TestCase):
|
|||
changes = self.get_changes([], [self.book, self.author_with_book_order_wrt])
|
||||
# Right number/type of migrations?
|
||||
self.assertNumberMigrations(changes, 'testapp', 1)
|
||||
self.assertOperationTypes(changes, 'testapp', 0, ["CreateModel", "AlterOrderWithRespectTo"])
|
||||
self.assertOperationAttributes(changes, 'testapp', 0, 1, name="author", order_with_respect_to="book")
|
||||
self.assertOperationTypes(changes, 'testapp', 0, ["CreateModel"])
|
||||
self.assertOperationAttributes(
|
||||
changes, 'testapp', 0, 0, name="Author", options={'order_with_respect_to': 'book'}
|
||||
)
|
||||
self.assertNotIn("_order", [name for name, field in changes['testapp'][0].operations[0].fields])
|
||||
|
||||
def test_alter_model_managers(self):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue