Exemplo n.º 1
0
 def test_when_unread(self, mock_send):
     """The send method should be called when a user has unread notifications."""
     NotificationFactory(user=self.user)
     tasks.daily_digest()
     mock_send.assert_called_with(
         self.user, u'Daily Digest', relativedelta(days=1)
     )
Exemplo n.º 2
0
 def test_when_no_unread(self, mock_send):
     """The send method should not be called when a user does not have unread notifications."""
     tasks.daily_digest()
     mock_send.assert_not_called()
Exemplo n.º 3
0
 def test_when_unread(self, mock_send):
     """The send method should be called when a user has unread notifications."""
     NotificationFactory(user=self.user)
     tasks.daily_digest()
     mock_send.assert_called_with(self.user.pk, "Daily Digest", "daily")