コード例 #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)
     )
コード例 #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()
コード例 #3
0
ファイル: test_tasks.py プロジェクト: WPMedia/muckrock
 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")