diff --git a/tests/migrations/test_commands.py b/tests/migrations/test_commands.py
index c9efa09..7678257 100644
a
|
b
|
import sys
|
9 | 9 | |
10 | 10 | from django.apps import apps |
11 | 11 | from django.core.management import CommandError, call_command |
12 | | from django.db import DatabaseError, connection, connections, models |
| 12 | from django.db import ( |
| 13 | ConnectionHandler, DatabaseError, connection, connections, models, |
| 14 | ) |
13 | 15 | from django.db.migrations.exceptions import InconsistentMigrationHistory |
14 | 16 | from django.db.migrations.recorder import MigrationRecorder |
15 | 17 | from django.test import ignore_warnings, mock, override_settings |
… |
… |
class MakeMigrationsTests(MigrationTestBase):
|
580 | 582 | call_command('makemigrations', 'migrations', '--empty', '-n', 'a', '-v', '0') |
581 | 583 | self.assertTrue(os.path.exists(os.path.join(migration_dir, '0002_a.py'))) |
582 | 584 | |
| 585 | def test_makemigrations_empty_connections(self): |
| 586 | empty_connections = ConnectionHandler({ |
| 587 | 'default': {}, |
| 588 | }) |
| 589 | with mock.patch('django.core.management.commands.makemigrations.connections', new=empty_connections): |
| 590 | with self.temporary_migration_module() as migration_dir: |
| 591 | call_command('makemigrations', verbosity=0) |
| 592 | |
583 | 593 | def test_failing_migration(self): |
584 | 594 | # If a migration fails to serialize, it shouldn't generate an empty file. #21280 |
585 | 595 | apps.register_model('migrations', UnserializableModel) |