コード例 #1
0
ファイル: moderator.py プロジェクト: nishant1/django-gstudio
 def test_email(self):
     comment = comments.get_model().objects.create(
         comment='My Comment', user=self.author, is_public=True,
         content_object=self.objecttype, site=self.site)
     self.assertEquals(len(mail.outbox), 0)
     moderator = ObjecttypeCommentModerator(Objecttype)
     moderator.email_reply = False
     moderator.email_authors = False
     moderator.mail_comment_notification_recipients = []
     moderator.email(comment, self.objecttype, 'request')
     self.assertEquals(len(mail.outbox), 0)
     moderator.email_reply = True
     moderator.email_authors = True
     moderator.mail_comment_notification_recipients = ['*****@*****.**']
     moderator.email(comment, self.objecttype, 'request')
     self.assertEquals(len(mail.outbox), 1)