From 287532588941d2941e19c4cd069bcbd8af889203 Mon Sep 17 00:00:00 2001 From: Jon Dufresne Date: Sun, 4 Oct 2015 11:16:12 -0700 Subject: 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``. --- tests/check_framework/tests.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'tests/check_framework') diff --git a/tests/check_framework/tests.py b/tests/check_framework/tests.py index 03bc01f843..7ae7b633e0 100644 --- a/tests/check_framework/tests.py +++ b/tests/check_framework/tests.py @@ -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 [ -- cgit v1.3