From e25759c1ac6efab53c18361a29d812745da8ab17 Mon Sep 17 00:00:00 2001 From: Matthias Date: Sat, 4 Dec 2021 04:08:11 +0100 Subject: [PATCH] check message counters too --- InvenTree/part/test_part.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/InvenTree/part/test_part.py b/InvenTree/part/test_part.py index 94ad4c695a..577e71127f 100644 --- a/InvenTree/part/test_part.py +++ b/InvenTree/part/test_part.py @@ -18,7 +18,7 @@ from .templatetags import inventree_extras import part.settings -from common.models import InvenTreeSetting, NotificationEntry +from common.models import InvenTreeSetting, NotificationEntry, NotificationMessage class TemplateTagTest(TestCase): @@ -518,6 +518,11 @@ class PartNotificationTest(BaseNotificationIntegrationTest): def test_notification(self): self._notification_run() + # There should be 1 notification message right now + self.assertEqual(NotificationMessage.objects.all().count(), 1) + # Try again -> cover the already send line self.part.save() + # There should not be more messages + self.assertEqual(NotificationMessage.objects.all().count(), 1)