mirror of
https://github.com/inventree/InvenTree.git
synced 2025-06-18 13:05:42 +00:00
Ensure an error gets logged when a delivery method fails (#3144)
* Ensure an error gets logged when a delivery method fails - Refactor existing code to log a custom error to the database - Limit error notifications to UI * Adjust unit test * Clear existing notifications before run * Add some debug to work out what is going on * Accommodate extra notification
This commit is contained in:
@ -616,6 +616,8 @@ class BaseNotificationIntegrationTest(InvenTreeTestCase):
|
||||
# reload notification methods
|
||||
storage.collect(run_class)
|
||||
|
||||
NotificationEntry.objects.all().delete()
|
||||
|
||||
# There should be no notification runs
|
||||
self.assertEqual(NotificationEntry.objects.all().count(), 0)
|
||||
|
||||
@ -630,8 +632,8 @@ class BaseNotificationIntegrationTest(InvenTreeTestCase):
|
||||
self.part.set_starred(self.user, True)
|
||||
self.part.save()
|
||||
|
||||
# There should be 1 notification
|
||||
self.assertEqual(NotificationEntry.objects.all().count(), 1)
|
||||
# There should be 1 (or 2) notifications - in some cases an error is generated, which creates a subsequent notification
|
||||
self.assertIn(NotificationEntry.objects.all().count(), [1, 2])
|
||||
|
||||
|
||||
class PartNotificationTest(BaseNotificationIntegrationTest):
|
||||
|
Reference in New Issue
Block a user