diff --git a/InvenTree/common/tests.py b/InvenTree/common/tests.py index 5b0249272e..9138af7cf0 100644 --- a/InvenTree/common/tests.py +++ b/InvenTree/common/tests.py @@ -8,7 +8,10 @@ from django.contrib.auth import get_user_model from .models import InvenTreeSetting from .models import NotificationEntry -from .notifications import NotificationMethod +from .notifications import NotificationMethod, SingleNotificationMethod, BulkNotificationMethod + +from part.test_part import BaseNotificationIntegrationTest + class SettingsTest(TestCase): """ @@ -110,7 +113,7 @@ class NotificationEntryTest(TestCase): self.assertTrue(NotificationEntry.check_recent('test.notification', 1, delta)) -class NotificationTests(TestCase): +class NotificationTests(BaseNotificationIntegrationTest): def test_NotificationMethod(self): """ensure the implementation requirements are tested""" @@ -128,4 +131,23 @@ class NotificationTests(TestCase): with self.assertRaises(NotImplementedError): AnotherFalseNotificationMethod('', '', '') + def test_SingleNotificationMethod(self): + """ensure the implementation requirements are tested""" + + class WrongImplementation(SingleNotificationMethod): + pass + + with self.assertRaises(NotImplementedError): + self._notification_run() + + def test_BulkNotificationMethod(self): + """ensure the implementation requirements are tested""" + + class WrongImplementation(BulkNotificationMethod): + pass + + with self.assertRaises(NotImplementedError): + self._notification_run() + + # A integration test for notifications is provided in test_part.PartNotificationTest