Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Remove overzealous migration flushes from migration test suite

  • Loading branch information...
commit f146e70cb1cfe34a9993a9a1d95faf2bb8b15ab1 1 parent c17cd15
@andrewgodwin andrewgodwin authored
Showing with 3 additions and 4 deletions.
  1. +3 −4 tests/migrations/test_executor.py
View
7 tests/migrations/test_executor.py
@@ -21,7 +21,6 @@ def test_run(self):
Tests running a simple set of migrations.
"""
executor = MigrationExecutor(connection)
- executor.recorder.flush()
# Let's look at the plan first and make sure it's up to scratch
plan = executor.migration_plan([("migrations", "0002_second")])
self.assertEqual(
@@ -61,7 +60,6 @@ def test_run_with_squashed(self):
Tests running a squashed migration from zero (should ignore what it replaces)
"""
executor = MigrationExecutor(connection)
- executor.recorder.flush()
# Check our leaf node is the squashed one
leaves = [key for key in executor.loader.graph.leaf_nodes() if key[0] == "migrations"]
self.assertEqual(leaves, [("migrations", "0001_squashed_0002")])
@@ -128,7 +126,9 @@ def test_empty_plan(self):
plan = executor.migration_plan([("migrations", "0002_second"), ("sessions", "0001_initial")])
self.assertEqual(plan, [])
# Erase all the fake records
- executor.recorder.flush()
+ executor.recorder.record_unapplied("sessions", "0001_initial")
+ executor.recorder.record_unapplied("migrations", "0002_second")
+ executor.recorder.record_unapplied("migrations", "0001_initial")
@override_settings(MIGRATION_MODULES={"migrations": "migrations.test_migrations"})
def test_soft_apply(self):
@@ -140,7 +140,6 @@ def test_soft_apply(self):
def fake_storer(phase, migration, fake):
state["faked"] = fake
executor = MigrationExecutor(connection, progress_callback=fake_storer)
- executor.recorder.flush()
# Were the tables there before?
self.assertTableNotExists("migrations_author")
self.assertTableNotExists("migrations_tribble")
Please sign in to comment.
Something went wrong with that request. Please try again.