Fixed #24375 -- Added Migration.initial attribute

The new attribute is checked when the `migrate --fake-initial` option
is used. initial will be set to True for all initial migrations (this
is particularly useful when initial migrations are split) as well as
for squashed migrations.
This commit is contained in:
Andrei Kulakov 2015-03-31 16:30:39 -04:00 committed by Tim Graham
parent a2b999dfca
commit db97a88495
16 changed files with 232 additions and 16 deletions

View file

@ -877,6 +877,9 @@ class AutodetectorTests(TestCase):
self.assertOperationTypes(changes, 'otherapp', 1, ["AddField"])
self.assertMigrationDependencies(changes, 'otherapp', 0, [])
self.assertMigrationDependencies(changes, 'otherapp', 1, [("otherapp", "auto_1"), ("testapp", "auto_1")])
# both split migrations should be `initial`
self.assertTrue(changes['otherapp'][0].initial)
self.assertTrue(changes['otherapp'][1].initial)
def test_same_app_circular_fk_dependency(self):
"""