def test_reply_comment_user_notification(self):
        self.portal.MailHost.reset()
        setProperties(self.prefs, 'enable_reply_user_notification')
        self.my_doc.discussion_reply('A Reply for my_doc',
                                     'text of reply for my_doc')
        self.failIf(testMailExistance(self), 'Mail was sended for simple reply'
                                      ' when enable_reply_user_notification.')

        reply = self.discussion.getDiscussionFor(self.my_doc).getReplies()[0]
        reply.discussion_reply('A Reply for comment',
                               'text of reply for comment')
        self.discussion.getDiscussionFor(self.my_doc).getReplies()[0]
        self.failUnless(testMailExistance(self),
            'Mail was not sended when enable_reply_user_notification.')
    def test_rejected_comment_notification(self):
        self.portal.MailHost.reset()
        setProperties(self.prefs, 'enable_rejected_user_notification',
                      'enable_moderation')
        self.my_doc.discussion_reply('A Reply for my_doc',
                                     'text of reply for my_doc')
        self.failIf(testMailExistance(self), 'Mail was sended when '
                    'enable_rejected_user_notification was enabled.')

        reply = self.discussion.getDiscussionFor(self.my_doc).getReplies()[0]
        self.portal.REQUEST.set('ids', [reply.getId()])
        self.portal.prefs_recent_comments_delete()
        self.failUnless(testMailExistance(self),
            'Mail was not sended when enable_rejected_user_notification.')
 def test_approve_comment_user__notification(self):
     self.portal.MailHost.reset()
     setProperties(self.prefs, 'enable_approve_user_notification')
     self.my_doc.discussion_reply('A Reply for my_doc',
                                  'text of reply for my_doc')
     self.failUnless(testMailExistance(self),
         'Mail was not sended when enable_approve_user_notification.')
 def test_notificafion_disabled(self):
     self.portal.MailHost.reset()
     setProperties(self.prefs)
     self.my_doc.discussion_reply('A Reply for my_doc',
                                  'text of reply for my_doc')
     self.failIf(testMailExistance(self),
                 'Mail was sended when all notification was disabled.')