diff --git a/InvenTree/InvenTree/status.py b/InvenTree/InvenTree/status.py index 1c2adb8821..cc9df701c6 100644 --- a/InvenTree/InvenTree/status.py +++ b/InvenTree/InvenTree/status.py @@ -89,15 +89,15 @@ def check_system_health(**kwargs): result = True - if not is_worker_running(**kwargs): + if not is_worker_running(**kwargs): # pragma: no cover result = False logger.warning(_("Background worker check failed")) - if not is_email_configured(): + if not is_email_configured(): # pragma: no cover result = False logger.warning(_("Email backend not configured")) - if not result: + if not result: # pragma: no cover logger.warning(_("InvenTree system health checks failed")) return result diff --git a/InvenTree/InvenTree/tests.py b/InvenTree/InvenTree/tests.py index 7fd62908a0..5caa59e158 100644 --- a/InvenTree/InvenTree/tests.py +++ b/InvenTree/InvenTree/tests.py @@ -12,6 +12,7 @@ from djmoney.contrib.exchange.exceptions import MissingRate from .validators import validate_overage, validate_part_name from . import helpers from . import version +from . import status from decimal import Decimal @@ -389,3 +390,12 @@ class CurrencyTests(TestCase): # Convert to a symbol which is not covered with self.assertRaises(MissingRate): convert_money(Money(100, 'GBP'), 'ZWL') + + +class TestStatus(TestCase): + """ + Unit tests for status functions + """ + + def test_check_system_healt(self): + self.assertTrue(status.check_system_health())