Example #1
0
 def test_follow_notification(self):
     follow = Follow.objects.filter().order_by('?')[0]
     with mock_signal_receiver(follow_done) as receiver:
         follow_done.send(sender=self, follow=follow)
         self.assertEqual(receiver.call_count, 1)
         self.assertEqual(len(mail.outbox), 1)
         send_mail = mail.outbox[0]
         expected_to = [follow.following.email]
         self.assertEqual(expected_to, send_mail.to)
Example #2
0
 def post_save(self, obj, created=False):
     follow_done.send(sender=self, follow=obj)