mirror of
				https://github.com/inventree/InvenTree.git
				synced 2025-10-30 20:55:42 +00:00 
			
		
		
		
	more implementation tests
This commit is contained in:
		| @@ -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 | ||||
|   | ||||
		Reference in New Issue
	
	Block a user