Skip to content
Snippets Groups Projects
Commit 5b96e561 authored by Robert Goldmann's avatar Robert Goldmann
Browse files

Fixed #48 - GarbageContainerScheduleTile: notifications are send multiple times per day

parent 0c968499
No related branches found
No related tags found
No related merge requests found
......@@ -94,7 +94,6 @@ class GarbageContainerScheduleTile(Tile):
return
if self._is_already_notified(now):
self._lastNotificationDate = None
return
self._lastNotificationDate = now.date()
......
......@@ -85,3 +85,14 @@ class TestSendNotification:
tile._send_notification(1, '')
requestsMock.post.assert_called_once()
@mock.patch('logic.Helpers.requests')
def test_already_notified_should_skip_sending_even_if_already_skipped_before(self, requestsMock):
tile = GarbageContainerScheduleTile('myGarbageScheduleTile', example_settings(True), 10)
requestsMock.post.return_value.status_code = 200
tile._send_notification(1, '')
tile._send_notification(1, '')
tile._send_notification(1, '')
requestsMock.post.assert_called_once()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment