mirror of
				https://github.com/inventree/InvenTree.git
				synced 2025-10-31 05:05:42 +00:00 
			
		
		
		
	seperate wrong implementations into own cases
This commit is contained in:
		| @@ -67,25 +67,13 @@ class BaseNotificationTests(BaseNotificationIntegrationTest): | |||||||
|         self._notification_run() |         self._notification_run() | ||||||
|  |  | ||||||
|  |  | ||||||
| class ClassNotificationTests(BaseNotificationIntegrationTest): | class BulkNotificationMethodTests(BaseNotificationIntegrationTest): | ||||||
|  |  | ||||||
|     def test_SingleNotificationMethod(self): |  | ||||||
|         """ensure the implementation requirements are tested""" |  | ||||||
|  |  | ||||||
|         class WrongImplementation(SingleNotificationMethod): |  | ||||||
|             METHOD_NAME = 'WrongImplementation1' |  | ||||||
|  |  | ||||||
|             def get_targets(self): |  | ||||||
|                 return [1, ] |  | ||||||
|  |  | ||||||
|         with self.assertRaises(NotImplementedError): |  | ||||||
|             self._notification_run() |  | ||||||
|  |  | ||||||
|     def test_BulkNotificationMethod(self): |     def test_BulkNotificationMethod(self): | ||||||
|         """ensure the implementation requirements are tested""" |         """ensure the implementation requirements are tested""" | ||||||
|  |  | ||||||
|         class WrongImplementation(BulkNotificationMethod): |         class WrongImplementation(BulkNotificationMethod): | ||||||
|             METHOD_NAME = 'WrongImplementation2' |             METHOD_NAME = 'WrongImplementationBulk' | ||||||
|  |  | ||||||
|             def get_targets(self): |             def get_targets(self): | ||||||
|                 return [1, ] |                 return [1, ] | ||||||
| @@ -94,4 +82,18 @@ class ClassNotificationTests(BaseNotificationIntegrationTest): | |||||||
|             self._notification_run() |             self._notification_run() | ||||||
|  |  | ||||||
|  |  | ||||||
|  | class SingleNotificationMethodTests(BaseNotificationIntegrationTest): | ||||||
|  |  | ||||||
|  |     def test_SingleNotificationMethod(self): | ||||||
|  |         """ensure the implementation requirements are tested""" | ||||||
|  |  | ||||||
|  |         class WrongImplementation(SingleNotificationMethod): | ||||||
|  |             METHOD_NAME = 'WrongImplementationSingle' | ||||||
|  |  | ||||||
|  |             def get_targets(self): | ||||||
|  |                 return [1, ] | ||||||
|  |  | ||||||
|  |         with self.assertRaises(NotImplementedError): | ||||||
|  |             self._notification_run() | ||||||
|  |  | ||||||
| # A integration test for notifications is provided in test_part.PartNotificationTest | # A integration test for notifications is provided in test_part.PartNotificationTest | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user