diff options
| author | Markus Holtermann <info@markusholtermann.eu> | 2015-09-12 10:24:41 +1000 |
|---|---|---|
| committer | Markus Holtermann <info@markusholtermann.eu> | 2015-09-12 10:38:15 +1000 |
| commit | f45ee1974696c8fc17ccfe12ef9e4188e29543a2 (patch) | |
| tree | 40ca967c55a7d161e86bdf4222b180af45d06a0a /tests | |
| parent | a3c01b0dd8060f00a5ffd2589a776b4f618af6d9 (diff) | |
Refs #24919 -- Raised more helpful error message for disabled migrations
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/migrations/test_commands.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/migrations/test_commands.py b/tests/migrations/test_commands.py index 96206806ac..c0f71a8015 100644 --- a/tests/migrations/test_commands.py +++ b/tests/migrations/test_commands.py @@ -593,6 +593,19 @@ class MakeMigrationsTests(MigrationTestBase): self.assertIn('dependencies=[\n]', content) self.assertIn('operations=[\n]', content) + @override_settings(MIGRATION_MODULES={"migrations": None}) + def test_makemigrations_disabled_migrations_for_app(self): + """ + makemigrations raises a nice error when migrations are disabled for an + app. + """ + msg = ( + "Django can't create migrations for app 'migrations' because migrations " + "have been disabled via the MIGRATION_MODULES setting." + ) + with self.assertRaisesMessage(ValueError, msg): + call_command("makemigrations", "migrations", empty=True, verbosity=0) + def test_makemigrations_no_changes_no_apps(self): """ Makes sure that makemigrations exits when there are no changes and no apps are specified. |
