Fixed #32296 -- Added --skip-checks option to runserver command.

This commit is contained in:
Hasan Ramezani 2020-12-24 16:29:54 +01:00 committed by Mariusz Felisiak
parent e8b4f23115
commit 34aa4f1997
4 changed files with 38 additions and 4 deletions

View file

@ -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):