summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authoroliver <myungsekyo@gmail.com>2018-06-25 23:43:12 +0900
committerTim Graham <timograham@gmail.com>2018-06-25 10:43:12 -0400
commit6b3e17bab61b94a307d5b276480f8a0e125cb2e5 (patch)
treedd43b6e11b7fcfb9d293723410539719a0b1f719 /tests
parente7185a6514ee83802f07ca1f6d2dff615b8fdfed (diff)
Fixed #29518 -- Added validation for sqlmigrate's app_label argument.
Diffstat (limited to 'tests')
-rw-r--r--tests/migrations/test_commands.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/migrations/test_commands.py b/tests/migrations/test_commands.py
index 4f01a3b665..f625a47c7f 100644
--- a/tests/migrations/test_commands.py
+++ b/tests/migrations/test_commands.py
@@ -1434,6 +1434,14 @@ class AppLabelErrorTests(TestCase):
with self.assertRaisesMessage(CommandError, self.did_you_mean_auth_error):
call_command('migrate', 'django.contrib.auth')
+ def test_sqlmigrate_nonexistent_app_label(self):
+ with self.assertRaisesMessage(CommandError, self.nonexistent_app_error):
+ call_command('sqlmigrate', 'nonexistent_app', '0002')
+
+ def test_sqlmigrate_app_name_specified_as_label(self):
+ with self.assertRaisesMessage(CommandError, self.did_you_mean_auth_error):
+ call_command('sqlmigrate', 'django.contrib.auth', '0002')
+
def test_squashmigrations_nonexistent_app_label(self):
with self.assertRaisesMessage(CommandError, self.nonexistent_app_error):
call_command('squashmigrations', 'nonexistent_app', '0002')