mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
more implementation tests
This commit is contained in:
parent
ae13672273
commit
162d4347e7
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user