mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
add test for system healt checks
This commit is contained in:
parent
6bc53c1308
commit
ce88deeb3b
@ -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
|
||||
|
@ -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())
|
||||
|
Loading…
Reference in New Issue
Block a user