mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
fix tests + method name test
This commit is contained in:
parent
e18f7d49cc
commit
4e07b4bf72
@ -11,23 +11,33 @@ class NotificationTests(BaseNotificationIntegrationTest):
|
||||
"""ensure the implementation requirements are tested"""
|
||||
|
||||
class FalseNotificationMethod(NotificationMethod):
|
||||
pass
|
||||
METHOD_NAME = 'FalseNotification'
|
||||
|
||||
class AnotherFalseNotificationMethod(NotificationMethod):
|
||||
METHOD_NAME = 'AnotherFalseNotification'
|
||||
|
||||
def send(self):
|
||||
pass
|
||||
|
||||
class NoNameNotificationMethod(NotificationMethod):
|
||||
pass
|
||||
|
||||
with self.assertRaises(NotImplementedError):
|
||||
FalseNotificationMethod('', '', '')
|
||||
|
||||
with self.assertRaises(NotImplementedError):
|
||||
AnotherFalseNotificationMethod('', '', '')
|
||||
|
||||
with self.assertRaises(NotImplementedError):
|
||||
NoNameNotificationMethod('', '', '')
|
||||
|
||||
def test_SingleNotificationMethod(self):
|
||||
"""ensure the implementation requirements are tested"""
|
||||
print('TESTING SingleNotificationMethod')
|
||||
|
||||
class WrongImplementation(SingleNotificationMethod):
|
||||
METHOD_NAME = 'WrongImplementation1'
|
||||
|
||||
def setup(self):
|
||||
print('running setup on WrongImplementation')
|
||||
return super().setup()
|
||||
@ -40,6 +50,8 @@ class NotificationTests(BaseNotificationIntegrationTest):
|
||||
print('TESTING BulkNotificationMethod')
|
||||
|
||||
class WrongImplementation(BulkNotificationMethod):
|
||||
METHOD_NAME = 'WrongImplementation2'
|
||||
|
||||
def setup(self):
|
||||
print('running setup on WrongImplementation')
|
||||
return super().setup()
|
||||
|
Loading…
Reference in New Issue
Block a user