From 004687a29fb4a169ee0fc5e77213d0d7159b3a94 Mon Sep 17 00:00:00 2001 From: Matthias Date: Thu, 2 Dec 2021 10:14:04 +0100 Subject: [PATCH] test implementation checks --- InvenTree/common/tests.py | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/InvenTree/common/tests.py b/InvenTree/common/tests.py index 48838415b5..119edaabd0 100644 --- a/InvenTree/common/tests.py +++ b/InvenTree/common/tests.py @@ -8,7 +8,7 @@ from django.contrib.auth import get_user_model from .models import InvenTreeSetting from .models import NotificationEntry - +from .notifications import NotificationMethod class SettingsTest(TestCase): """ @@ -108,3 +108,23 @@ class NotificationEntryTest(TestCase): self.assertFalse(NotificationEntry.check_recent('test.notification2', 1, delta)) self.assertTrue(NotificationEntry.check_recent('test.notification', 1, delta)) + + +class NotificationTests(TestCase): + + def test_NotificationMethod(self): + """ensure the implementation requirements are tested""" + + class FalseNotificationMethod(NotificationMethod): + pass + + class AnotherFalseNotificationMethod(NotificationMethod): + def send(self): + pass + + with self.assertRaises(NotImplementedError): + FalseNotificationMethod('', '', '') + + with self.assertRaises(NotImplementedError): + AnotherFalseNotificationMethod('', '', '') +