Beispiel #1
0
 def test_email_content(self):
     num_followers = 2
     body_dicts = []
     from utils import tasks
     self._create_followers(self.video, num_followers)
     mail.outbox = []
     send_video_comment_notification(self.comment.pk)
     self.assertEqual(len(mail.outbox), num_followers)
     for msg in mail.outbox:
         self.assertEqual(msg.subject, u'admin left a comment on the video Hax')
Beispiel #2
0
 def test_simple_email(self):
     num_followers = 5
     self._create_followers(self.video, num_followers)
     mail.outbox = []
     send_video_comment_notification(self.comment.pk)
     self.assertEqual(len(mail.outbox), num_followers)
     email = mail.outbox[0]
     self.assertEqual(email.subject, SUBJECT_EMAIL_VIDEO_COMMENTED  % dict(user=self.comment.user.username,
                                                                       title=self.video.title_display()))
     return None