summaryrefslogtreecommitdiff
path: root/tests/admin_scripts
diff options
context:
space:
mode:
authorHasan Ramezani <hasan.r67@gmail.com>2020-12-24 16:29:54 +0100
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2021-01-18 12:51:35 +0100
commit34aa4f1997bd7f1fb0c43d6d1c6848e86b928f2e (patch)
treef04e2ea28c149c3c98b185dd6a42f6c75ea2b6dc /tests/admin_scripts
parente8b4f23115237047c907fca4565020f30ad35a7c (diff)
downloaddjango-34aa4f1997bd7f1fb0c43d6d1c6848e86b928f2e.tar.gz
Fixed #32296 -- Added --skip-checks option to runserver command.
Diffstat (limited to 'tests/admin_scripts')
-rw-r--r--tests/admin_scripts/tests.py23
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/admin_scripts/tests.py b/tests/admin_scripts/tests.py
index d9ec07a3e3..fd94d4919f 100644
--- a/tests/admin_scripts/tests.py
+++ b/tests/admin_scripts/tests.py
@@ -1313,6 +1313,29 @@ class ManageRunserver(SimpleTestCase):
# You have # ...
self.assertIn('unapplied migration(s)', self.output.getvalue())
+ @mock.patch('django.core.management.commands.runserver.run')
+ @mock.patch('django.core.management.base.BaseCommand.check_migrations')
+ @mock.patch('django.core.management.base.BaseCommand.check')
+ def test_skip_checks(self, mocked_check, *mocked_objects):
+ call_command(
+ 'runserver',
+ use_reloader=False,
+ skip_checks=True,
+ stdout=self.output,
+ )
+ self.assertNotIn('Performing system checks...', self.output.getvalue())
+ mocked_check.assert_not_called()
+
+ self.output.truncate(0)
+ call_command(
+ 'runserver',
+ use_reloader=False,
+ skip_checks=False,
+ stdout=self.output,
+ )
+ self.assertIn('Performing system checks...', self.output.getvalue())
+ mocked_check.assert_called()
+
class ManageRunserverMigrationWarning(TestCase):