diff --git a/InvenTree/plugin/builtin/integration/test_core_notifications.py b/InvenTree/plugin/builtin/integration/test_core_notifications.py index 1ff60c74b1..88c166bf78 100644 --- a/InvenTree/plugin/builtin/integration/test_core_notifications.py +++ b/InvenTree/plugin/builtin/integration/test_core_notifications.py @@ -1,5 +1,7 @@ """Tests for core_notifications.""" +from django.core import mail + from part.test_part import BaseNotificationIntegrationTest from plugin import registry from plugin.builtin.integration.core_notifications import \ @@ -12,6 +14,9 @@ class CoreNotificationTestTests(BaseNotificationIntegrationTest): def test_email(self): """Ensure that the email notifications run.""" + # No email should be send + self.assertEqual(len(mail.outbox), 0) + # enable plugin and set mail setting to true plugin = registry.plugins.get('corenotificationsplugin') plugin.set_setting('ENABLE_NOTIFICATION_EMAILS', True) @@ -25,3 +30,6 @@ class CoreNotificationTestTests(BaseNotificationIntegrationTest): # run through self._notification_run(CoreNotificationsPlugin.EmailNotification) + + # Now one mail should be send + self.assertEqual(len(mail.outbox), 1)