summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Godwin <andrew@aeracode.org>2014-05-29 16:43:49 -0700
committerAndrew Godwin <andrew@aeracode.org>2014-05-29 16:44:29 -0700
commit16d037c4f06104670b88989daa76b05a2f10fd85 (patch)
treecd02c35c1e341d02549322fb7939fc7a9ea43477
parent35bdf87034000d7e00521ed62f0e12f9bed6ea9c (diff)
[1.7.x] Fix additional test failures caused by migration pollution
-rw-r--r--tests/migrations/test_loader.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/tests/migrations/test_loader.py b/tests/migrations/test_loader.py
index 34bc340495..01ead5e8ea 100644
--- a/tests/migrations/test_loader.py
+++ b/tests/migrations/test_loader.py
@@ -18,23 +18,23 @@ class RecorderTests(TestCase):
"""
recorder = MigrationRecorder(connection)
self.assertEqual(
- recorder.applied_migrations(),
+ set((x, y) for (x, y) in recorder.applied_migrations() if x == "myapp"),
set(),
)
recorder.record_applied("myapp", "0432_ponies")
self.assertEqual(
- recorder.applied_migrations(),
+ set((x, y) for (x, y) in recorder.applied_migrations() if x == "myapp"),
set([("myapp", "0432_ponies")]),
)
# That should not affect records of another database
recorder_other = MigrationRecorder(connections['other'])
self.assertEqual(
- recorder_other.applied_migrations(),
+ set((x, y) for (x, y) in recorder_other.applied_migrations() if x == "myapp"),
set(),
)
recorder.record_unapplied("myapp", "0432_ponies")
self.assertEqual(
- recorder.applied_migrations(),
+ set((x, y) for (x, y) in recorder.applied_migrations() if x == "myapp"),
set(),
)
@@ -136,14 +136,14 @@ class LoaderTests(TestCase):
recorder = MigrationRecorder(connection)
# Loading with nothing applied should just give us the one node
self.assertEqual(
- len(migration_loader.graph.nodes),
+ len([x for x in migration_loader.graph.nodes if x[0] == "migrations"]),
1,
)
# However, fake-apply one migration and it should now use the old two
recorder.record_applied("migrations", "0001_initial")
migration_loader.build_graph()
self.assertEqual(
- len(migration_loader.graph.nodes),
+ len([x for x in migration_loader.graph.nodes if x[0] == "migrations"]),
2,
)
recorder.flush()