diff options
| author | Claude Paroz <claude@2xlibre.net> | 2018-06-19 09:35:55 +0200 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2018-06-20 15:42:40 -0400 |
| commit | c723a1ff8e76aaef227d5af7a57006cc9bfd2fc8 (patch) | |
| tree | 64720120eaf53292cb55a5118a4772521e807cae /tests | |
| parent | c3c7d15c34d6174ff25a49d7c9a57da140769567 (diff) | |
Fixed #29506 -- Added validation for migrate's app_label option.
Thanks MyungSeKyo for the report and the initial patch.
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/migrations/test_commands.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/migrations/test_commands.py b/tests/migrations/test_commands.py index c9791af51e..494d5cd211 100644 --- a/tests/migrations/test_commands.py +++ b/tests/migrations/test_commands.py @@ -1425,3 +1425,11 @@ class AppLabelErrorTests(TestCase): with self.assertRaises(SystemExit): call_command('makemigrations', 'django.contrib.auth', stderr=err) self.assertIn(self.did_you_mean_auth_error, err.getvalue()) + + def test_migrate_nonexistent_app_label(self): + with self.assertRaisesMessage(CommandError, self.nonexistent_app_error): + call_command('migrate', 'nonexistent_app') + + def test_migrate_app_name_specified_as_label(self): + with self.assertRaisesMessage(CommandError, self.did_you_mean_auth_error): + call_command('migrate', 'django.contrib.auth') |
