1
0
mirror of https://github.com/django/django.git synced 2025-10-23 21:59:11 +00:00

Fixed #25500 -- Added --fail-level option to check command.

This option specifies the level that check command exits with a
non-zero status. Default is ``ERROR``.
This commit is contained in:
Jon Dufresne
2015-10-04 11:16:12 -07:00
committed by Tim Graham
parent b215a3ab63
commit 2875325889
6 changed files with 34 additions and 6 deletions

View File

@@ -116,7 +116,7 @@ def simple_system_check(**kwargs):
def tagged_system_check(**kwargs):
tagged_system_check.kwargs = kwargs
return []
return [checks.Warning('System Check')]
tagged_system_check.tags = ['simpletag']
@@ -192,6 +192,11 @@ class CheckCommandTests(SimpleTestCase):
call_command('check', deploy=True, tags=['deploymenttag'])
self.assertIn('Deployment Check', sys.stderr.getvalue())
@override_system_checks([tagged_system_check])
def test_fail_level(self):
with self.assertRaises(CommandError):
call_command('check', fail_level='WARNING')
def custom_error_system_check(app_configs, **kwargs):
return [