diff options
| author | Claude Paroz <claude@2xlibre.net> | 2014-04-30 16:53:20 +0200 |
|---|---|---|
| committer | Claude Paroz <claude@2xlibre.net> | 2014-04-30 16:55:12 +0200 |
| commit | 1084456ac2e707fc562906e95ad78f409dcc9325 (patch) | |
| tree | ca7f62d02784462c983f0caef250fa0b71535fdf /tests | |
| parent | bb5c7e4e8d783bf3a2880ab5cf1fa57fd35cd198 (diff) | |
[1.7.x] Fixed #22474 -- Made migration recorder aware of multiple databases
Thanks Tim Graham for the review.
Backport of 7c54f8cce from master.
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/migrations/test_loader.py | 8 |
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(), |
