From 252abb920f45e6dcb2ccf547a6657fb9757777c8 Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Mon, 19 Apr 2021 20:49:24 +1000 Subject: [PATCH] Do not print EMAIL warning if in TEST mode --- InvenTree/InvenTree/status.py | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/InvenTree/InvenTree/status.py b/InvenTree/InvenTree/status.py index e9846e445a..5531d4c270 100644 --- a/InvenTree/InvenTree/status.py +++ b/InvenTree/InvenTree/status.py @@ -56,17 +56,26 @@ def is_email_configured(): configured = True if not settings.EMAIL_HOST: - logger.warning("EMAIL_HOST is not configured") configured = False + # Display warning unless in test mode + if not settings.TESTING: + logger.warning("EMAIL_HOST is not configured") + if not settings.EMAIL_HOST_USER: - logger.warning("EMAIL_HOST_USER is not configured") configured = False + + # Display warning unless in test mode + if not settings.TESTING: + logger.warning("EMAIL_HOST_USER is not configured") if not settings.EMAIL_HOST_PASSWORD: - logger.warning("EMAIL_HOST_PASSWORD is not configured") configured = False + # Display warning unless in test mode + if not settings.TESTING: + logger.warning("EMAIL_HOST_PASSWORD is not configured") + return configured