diff options
| author | Jon Dufresne <jon.dufresne@gmail.com> | 2015-10-04 11:16:12 -0700 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2015-10-05 17:11:40 -0400 |
| commit | 287532588941d2941e19c4cd069bcbd8af889203 (patch) | |
| tree | 465d5343ad05456b39ce8893ccfcfb8ca9882458 /tests/check_framework | |
| parent | b215a3ab63d1c34746855594656e988561484fe3 (diff) | |
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``.
Diffstat (limited to 'tests/check_framework')
| -rw-r--r-- | tests/check_framework/tests.py | 7 |
1 files changed, 6 insertions, 1 deletions
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 [ |
