summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorSanket Saurav <sanketsaurav@gmail.com>2018-05-05 17:03:20 +0530
committerTim Graham <timograham@gmail.com>2018-05-05 18:26:33 -0400
commit079f3243577be01068543a43d1bfb42bcf84b8b3 (patch)
tree6b0fc682c207e891eb5f1ca4e21211ebf15bab3c /tests
parent10b44e45256ddda4258ae032b8d4725a3e3284e6 (diff)
Fixed #28913 -- Fixed error handling when MIGRATIONS_MODULES specifies a nonexistent top-level package.
Diffstat (limited to 'tests')
-rw-r--r--tests/migrations/test_commands.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/migrations/test_commands.py b/tests/migrations/test_commands.py
index 8a77624e34..933c00eada 100644
--- a/tests/migrations/test_commands.py
+++ b/tests/migrations/test_commands.py
@@ -1116,6 +1116,16 @@ class MakeMigrationsTests(MigrationTestBase):
# Command output indicates the migration is created.
self.assertIn(" - Create model SillyModel", out.getvalue())
+ @override_settings(MIGRATION_MODULES={'migrations': 'some.nonexistent.path'})
+ def test_makemigrations_migrations_modules_nonexistent_toplevel_package(self):
+ msg = (
+ 'Could not locate an appropriate location to create migrations '
+ 'package some.nonexistent.path. Make sure the toplevel package '
+ 'exists and can be imported.'
+ )
+ with self.assertRaisesMessage(ValueError, msg):
+ call_command('makemigrations', 'migrations', empty=True, verbosity=0)
+
def test_makemigrations_interactive_by_default(self):
"""
The user is prompted to merge by default if there are conflicts and