1
0
mirror of https://github.com/django/django.git synced 2025-10-23 21:59:11 +00:00

Fixed #22474 -- Made migration recorder aware of multiple databases

Thanks Tim Graham for the review.
This commit is contained in:
Claude Paroz
2014-04-30 16:53:20 +02:00
parent 7fd1b35ed7
commit 7c54f8cced
2 changed files with 21 additions and 7 deletions

View File

@@ -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(),