Merge pull request #2938 from dekkers/ticket_23071

Fixed #23071 -- Use last migration's name in dependency to other app
This commit is contained in:
Andrew Godwin 2014-07-25 08:53:57 -07:00
commit ed4812692e
9 changed files with 9 additions and 65 deletions

View file

@ -1069,7 +1069,8 @@ class AutodetectorTests(TestCase):
@override_settings(MIGRATION_MODULES={"migrations": "migrations.test_migrations"})
def test_last_dependency(self):
"""
Tests that a dependency to an app with existing migrations uses __latest__.
Tests that a dependency to an app with existing migrations uses the
last migration of that app.
"""
# Load graph
loader = MigrationLoader(connection)
@ -1084,4 +1085,4 @@ class AutodetectorTests(TestCase):
self.assertOperationTypes(changes, 'otherapp', 0, ["CreateModel"])
self.assertOperationAttributes(changes, 'otherapp', 0, 0, name="Book")
# Right dependencies?
self.assertEqual(changes['otherapp'][0].dependencies, [("migrations", "__latest__")])
self.assertEqual(changes['otherapp'][0].dependencies, [("migrations", "0002_second")])