summaryrefslogtreecommitdiff
path: root/tests/migrations/test_executor.py
diff options
context:
space:
mode:
authorSimon Charette <charette.s@gmail.com>2016-08-20 16:34:06 -0400
committerSimon Charette <charette.s@gmail.com>2016-08-24 01:17:18 -0400
commitd1757d8df486b689172d2584ded52fad916bcc33 (patch)
tree980ca1d049ea7743a95a81460181d81015160e50 /tests/migrations/test_executor.py
parentad25fe73506d80ffcaac135ad0a8d09552b70d70 (diff)
Fixed #27044 -- Included already applied migration changes in the post-migrate state when the execution plan is empty.
Refs #24100. Thanks tkhyn for the report and Tim for the review.
Diffstat (limited to 'tests/migrations/test_executor.py')
-rw-r--r--tests/migrations/test_executor.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/migrations/test_executor.py b/tests/migrations/test_executor.py
index b61f51f457..847b11c088 100644
--- a/tests/migrations/test_executor.py
+++ b/tests/migrations/test_executor.py
@@ -168,6 +168,14 @@ class ExecutorTests(MigrationTestBase):
("migrations2", "0001_initial"),
])
self.assertEqual(plan, [])
+ # The resulting state should include applied migrations.
+ state = executor.migrate([
+ ("migrations", "0002_second"),
+ ("migrations2", "0001_initial"),
+ ])
+ self.assertIn(('migrations', 'book'), state.models)
+ self.assertIn(('migrations', 'author'), state.models)
+ self.assertIn(('migrations2', 'otherauthor'), state.models)
# Erase all the fake records
executor.recorder.record_unapplied("migrations2", "0001_initial")
executor.recorder.record_unapplied("migrations", "0002_second")