summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorClaude Paroz <claude@2xlibre.net>2014-04-30 16:53:20 +0200
committerClaude Paroz <claude@2xlibre.net>2014-04-30 16:53:20 +0200
commit7c54f8cced37313572d72f59bd2ef7ce12aa8fe1 (patch)
tree024bceca3328002a7603a753e7c82fdebcdccef1 /tests
parent7fd1b35ed794e7d0a2a18f6ac168adba25a7de23 (diff)
Fixed #22474 -- Made migration recorder aware of multiple databases
Thanks Tim Graham for the review.
Diffstat (limited to 'tests')
-rw-r--r--tests/migrations/test_loader.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/tests/migrations/test_loader.py b/tests/migrations/test_loader.py
index f661a03b02..0e9b9c23d7 100644
--- a/tests/migrations/test_loader.py
+++ b/tests/migrations/test_loader.py
@@ -1,7 +1,7 @@
from unittest import skipIf
from django.test import TestCase, override_settings
-from django.db import connection
+from django.db import connection, connections
from django.db.migrations.loader import MigrationLoader, AmbiguityError
from django.db.migrations.recorder import MigrationRecorder
from django.utils import six
@@ -26,6 +26,12 @@ class RecorderTests(TestCase):
recorder.applied_migrations(),
set([("myapp", "0432_ponies")]),
)
+ # That should not affect records of another database
+ recorder_other = MigrationRecorder(connections['other'])
+ self.assertEqual(
+ recorder_other.applied_migrations(),
+ set(),
+ )
recorder.record_unapplied("myapp", "0432_ponies")
self.assertEqual(
recorder.applied_migrations(),