Exemplo n.º 1
0
    def test_email_reply(self):
        comment = Comment.objects.create(comment='My Comment 1',
                                         user=self.author, is_public=True,
                                         content_object=self.entry,
                                         site=self.site)
        moderator = EntryCommentModerator(Entry)
        moderator.email_notification_reply = True
        moderator.email_reply(comment, self.entry, 'request')
        self.assertEquals(len(mail.outbox), 0)

        comment = Comment.objects.create(comment='My Comment 2',
                                         user_email='*****@*****.**',
                                         content_object=self.entry,
                                         is_public=True, site=self.site)
        moderator.email_reply(comment, self.entry, 'request')
        self.assertEquals(len(mail.outbox), 0)

        comment = Comment.objects.create(comment='My Comment 3',
                                         user_email='*****@*****.**',
                                         content_object=self.entry,
                                         is_public=True, site=self.site)
        moderator.email_reply(comment, self.entry, 'request')
        self.assertEquals(len(mail.outbox), 1)
        self.assertEquals(mail.outbox[0].to, [u'*****@*****.**'])

        comment = Comment.objects.create(comment='My Comment 4',
                                         user=self.author, is_public=True,
                                         content_object=self.entry,
                                         site=self.site)
        moderator.email_reply(comment, self.entry, 'request')
        self.assertEquals(len(mail.outbox), 2)
        self.assertEquals(mail.outbox[1].to, [u'*****@*****.**',
                                              u'*****@*****.**'])
 def test_moderate_comment_on_entry_without_author(self):
     self.entry.authors.clear()
     comment = comments.get_model().objects.create(
         comment="My Comment", user=self.author, is_public=True, content_object=self.entry, site=self.site
     )
     moderator = EntryCommentModerator(Entry)
     moderator.auto_moderate_comments = False
     moderator.spam_checker_backends = ("zinnia.spam_checker.backends.all_is_spam",)
     self.assertEquals(moderator.moderate(comment, self.entry, "request"), True)
Exemplo n.º 3
0
 def test_do_email_notification(self):
     comment = comments.get_model().objects.create(
         comment='My Comment', user=self.author, is_public=True,
         content_object=self.entry, site=self.site)
     self.assertEquals(len(mail.outbox), 0)
     moderator = EntryCommentModerator(Entry)
     moderator.mail_comment_notification_recipients = ['*****@*****.**']
     moderator.do_email_notification(comment, self.entry, 'request')
     self.assertEquals(len(mail.outbox), 1)
Exemplo n.º 4
0
 def test_do_email_notification(self):
     comment = comments.get_model().objects.create(
         comment='My Comment', user=self.author, is_public=True,
         content_object=self.entry, site=self.site)
     self.assertEquals(len(mail.outbox), 0)
     moderator = EntryCommentModerator(Entry)
     moderator.mail_comment_notification_recipients = ['*****@*****.**']
     moderator.do_email_notification(comment, self.entry, 'request')
     self.assertEquals(len(mail.outbox), 1)
Exemplo n.º 5
0
 def test_email(self):
     comment = Comment.objects.create(comment='My Comment',
                                      user=self.author, is_public=True,
                                      content_object=self.entry,
                                      site=self.site)
     self.assertEquals(len(mail.outbox), 0)
     moderator = EntryCommentModerator(Entry)
     moderator.email(comment, self.entry, 'request')
     self.assertEquals(len(mail.outbox), 1)
Exemplo n.º 6
0
 def test_email(self):
     comment = Comment.objects.create(comment='My Comment',
                                      user=self.author,
                                      is_public=True,
                                      content_object=self.entry,
                                      site=self.site)
     self.assertEquals(len(mail.outbox), 0)
     moderator = EntryCommentModerator(Entry)
     moderator.email(comment, self.entry, 'request')
     self.assertEquals(len(mail.outbox), 1)
 def test_moderate_comment_on_entry_without_author(self):
     self.entry.authors.clear()
     comment = comments.get_model().objects.create(
         comment='My Comment', user=self.author, is_public=True,
         content_object=self.entry, submit_date=timezone.now(),
         site=self.site)
     moderator = EntryCommentModerator(Entry)
     moderator.auto_moderate_comments = False
     moderator.spam_checker_backends = (
         'zinnia.spam_checker.backends.all_is_spam',)
     self.assertTrue(moderator.moderate(comment, self.entry, 'request'))
Exemplo n.º 8
0
 def test_moderate_comment_on_entry_without_author(self):
     self.entry.authors.clear()
     comment = comments.get_model().objects.create(
         comment='My Comment', user=self.author, is_public=True,
         content_object=self.entry, submit_date=timezone.now(),
         site=self.site)
     moderator = EntryCommentModerator(Entry)
     moderator.auto_moderate_comments = False
     moderator.spam_checker_backends = (
         'zinnia.spam_checker.backends.all_is_spam',)
     self.assertTrue(moderator.moderate(comment, self.entry, 'request'))
Exemplo n.º 9
0
 def test_moderate(self):
     comment = Comment.objects.create(comment='My Comment',
                                      user=self.author, is_public=True,
                                      content_object=self.entry,
                                      site=self.site)
     moderator = EntryCommentModerator(Entry)
     moderator.auto_moderate_comments = True
     self.assertEquals(moderator.moderate(comment, self.entry, 'request'),
                       True)
     moderator.auto_moderate_comments = False
     self.assertEquals(moderator.moderate(comment, self.entry, 'request'),
                       False)  # Because API key for Akismet is not defined
Exemplo n.º 10
0
 def test_moderate_comment_on_entry_without_author(self):
     self.entry.authors.clear()
     comment = comments.get_model().objects.create(
         comment='My Comment', user=self.author, is_public=True,
         content_object=self.entry, site=self.site)
     moderator = EntryCommentModerator(Entry)
     moderator.auto_moderate_comments = False
     moderator.spam_checker_backends = (
         'zinnia.spam_checker.backends.all_is_spam',)
     self.assertEquals(moderator.moderate(comment, self.entry, 'request'),
                       True)
     self.assertEquals(comments.get_model().objects.filter(
         flags__flag=SPAM).count(), 1)
 def test_do_email_notification(self):
     comment = comments.get_model().objects.create(
         comment="My Comment",
         user=self.author,
         is_public=True,
         content_object=self.entry,
         submit_date=timezone.now(),
         site=self.site,
     )
     self.assertEqual(len(mail.outbox), 0)
     moderator = EntryCommentModerator(Entry)
     moderator.mail_comment_notification_recipients = ["*****@*****.**"]
     moderator.do_email_notification(comment, self.entry, "request")
     self.assertEqual(len(mail.outbox), 1)
Exemplo n.º 12
0
 def test_do_email_authors_without_email(self):
     """
     https://github.com/Fantomas42/django-blog-zinnia/issues/145
     """
     comment = comments.get_model().objects.create(
         comment='My Comment',
         user=self.author,
         is_public=True,
         content_object=self.entry,
         submit_date=timezone.now(),
         site=self.site)
     self.assertEqual(len(mail.outbox), 0)
     moderator = EntryCommentModerator(Entry)
     moderator.email_authors = True
     moderator.mail_comment_notification_recipients = []
     contributor = Author.objects.create(username='******',
                                         email='*****@*****.**')
     self.entry.authors.add(contributor)
     moderator.do_email_authors(comment, self.entry, 'request')
     self.assertEqual(len(mail.outbox), 1)
     self.assertEqual(set(mail.outbox[0].to),
                      set(['*****@*****.**', '*****@*****.**']))
     mail.outbox = []
     contributor.email = ''
     contributor.save()
     moderator.do_email_authors(comment, self.entry, 'request')
     self.assertEqual(len(mail.outbox), 1)
     self.assertEqual(mail.outbox[0].to, ['*****@*****.**'])
Exemplo n.º 13
0
 def test_do_email_authors_without_email(self):
     """
     https://github.com/Fantomas42/django-blog-zinnia/issues/145
     """
     comment = comments.get_model().objects.create(
         comment='My Comment',
         user=self.author,
         is_public=True,
         content_object=self.entry,
         submit_date=timezone.now(),
         site=self.site)
     self.assertEqual(len(mail.outbox), 0)
     moderator = EntryCommentModerator(Entry)
     moderator.email_authors = True
     moderator.mail_comment_notification_recipients = []
     contributor = Author.objects.create(username='******',
                                         email='*****@*****.**')
     self.entry.authors.add(contributor)
     moderator.do_email_authors(comment, self.entry, 'request')
     self.assertEqual(len(mail.outbox), 1)
     #This test, as written, is flawed. It assumes that the database
     #returns the message's authors in the order they were added,
     #which is an invalid assumption.
     #For now, I'm changing the test. An alternative fix would be to add an
     #order(ing?) attribute in Author.Meta .
     self.assertEqual(set(mail.outbox[0].to),
                      set(['*****@*****.**', '*****@*****.**']))
     mail.outbox = []
     contributor.email = ''
     contributor.save()
     moderator.do_email_authors(comment, self.entry, 'request')
     self.assertEqual(len(mail.outbox), 1)
     self.assertEqual(mail.outbox[0].to, ['*****@*****.**'])
Exemplo n.º 14
0
 def test_moderate_comment_on_entry_without_author(self):
     self.entry.authors.clear()
     comment = comments.get_model().objects.create(
         comment='My Comment',
         user=self.author,
         is_public=True,
         content_object=self.entry,
         site=self.site)
     moderator = EntryCommentModerator(Entry)
     moderator.auto_moderate_comments = False
     moderator.spam_checker_backends = (
         'zinnia.spam_checker.backends.all_is_spam', )
     self.assertEquals(moderator.moderate(comment, self.entry, 'request'),
                       True)
     self.assertEquals(
         comments.get_model().objects.filter(flags__flag=SPAM).count(), 1)
Exemplo n.º 15
0
 def test_do_email_authors_without_email(self):
     """
     https://github.com/Fantomas42/django-blog-zinnia/issues/145
     """
     comment = comments.get_model().objects.create(
         comment='My Comment', user=self.author, is_public=True,
         content_object=self.entry, submit_date=timezone.now(),
         site=self.site)
     self.assertEqual(len(mail.outbox), 0)
     moderator = EntryCommentModerator(Entry)
     moderator.email_authors = True
     moderator.mail_comment_notification_recipients = []
     contributor = Author.objects.create(username='******',
                                         email='*****@*****.**')
     self.entry.authors.add(contributor)
     moderator.do_email_authors(comment, self.entry, 'request')
     self.assertEqual(len(mail.outbox), 1)
     #This test, as written, is flawed. It assumes that the database
     #returns the message's authors in the order they were added,
     #which is an invalid assumption.
     #For now, I'm changing the test. An alternative fix would be to add an
     #order(ing?) attribute in Author.Meta .
     self.assertEqual(
         set(mail.outbox[0].to),
         set(['*****@*****.**', '*****@*****.**']))
     mail.outbox = []
     contributor.email = ''
     contributor.save()
     moderator.do_email_authors(comment, self.entry, 'request')
     self.assertEqual(len(mail.outbox), 1)
     self.assertEqual(mail.outbox[0].to, ['*****@*****.**'])
Exemplo n.º 16
0
 def test_do_email_authors_without_email(self):
     """
     https://github.com/Fantomas42/django-blog-zinnia/issues/145
     """
     comment = comments.get_model().objects.create(
         comment='My Comment', user=self.author, is_public=True,
         content_object=self.entry, submit_date=timezone.now(),
         site=self.site)
     self.assertEqual(len(mail.outbox), 0)
     moderator = EntryCommentModerator(Entry)
     moderator.email_authors = True
     moderator.mail_comment_notification_recipients = []
     contributor = Author.objects.create(username='******',
                                         email='*****@*****.**')
     self.entry.authors.add(contributor)
     moderator.do_email_authors(comment, self.entry, 'request')
     self.assertEqual(len(mail.outbox), 1)
     self.assertEqual(
         set(mail.outbox[0].to),
         set(['*****@*****.**', '*****@*****.**']))
     mail.outbox = []
     contributor.email = ''
     contributor.save()
     moderator.do_email_authors(comment, self.entry, 'request')
     self.assertEqual(len(mail.outbox), 1)
     self.assertEqual(mail.outbox[0].to, ['*****@*****.**'])
Exemplo n.º 17
0
 def test_do_email_authors(self):
     comment = comments.get_model().objects.create(
         comment='My Comment', user=self.author, is_public=True,
         content_object=self.entry, submit_date=timezone.now(),
         site=self.site)
     self.assertEqual(len(mail.outbox), 0)
     moderator = EntryCommentModerator(Entry)
     moderator.email_authors = True
     moderator.mail_comment_notification_recipients = [
         '*****@*****.**', '*****@*****.**']
     moderator.do_email_authors(comment, self.entry, 'request')
     self.assertEqual(len(mail.outbox), 0)
     moderator.mail_comment_notification_recipients = []
     moderator.do_email_authors(comment, self.entry, 'request')
     self.assertEqual(len(mail.outbox), 1)
Exemplo n.º 18
0
 def test_do_email_authors(self):
     comment = comments.get_model().objects.create(
         comment="My Comment", user=self.author, is_public=True, content_object=self.entry, site=self.site
     )
     self.assertEquals(len(mail.outbox), 0)
     moderator = EntryCommentModerator(Entry)
     moderator.email_authors = True
     moderator.mail_comment_notification_recipients = [u"*****@*****.**", u"*****@*****.**"]
     moderator.do_email_authors(comment, self.entry, "request")
     self.assertEquals(len(mail.outbox), 0)
     moderator.mail_comment_notification_recipients = []
     moderator.do_email_authors(comment, self.entry, "request")
     self.assertEquals(len(mail.outbox), 1)
Exemplo n.º 19
0
 def test_do_email_authors(self):
     comment = comments.get_model().objects.create(
         comment='My Comment', user=self.author, is_public=True,
         content_object=self.entry, submit_date=timezone.now(),
         site=self.site)
     self.assertEqual(len(mail.outbox), 0)
     moderator = EntryCommentModerator(Entry)
     moderator.email_authors = True
     moderator.mail_comment_notification_recipients = [
         '*****@*****.**', '*****@*****.**']
     moderator.do_email_authors(comment, self.entry, 'request')
     self.assertEqual(len(mail.outbox), 0)
     moderator.mail_comment_notification_recipients = []
     moderator.do_email_authors(comment, self.entry, 'request')
     self.assertEqual(len(mail.outbox), 1)
Exemplo n.º 20
0
 def test_moderate(self):
     comment = comments.get_model().objects.create(
         comment='My Comment',
         user=self.author,
         is_public=True,
         content_object=self.entry,
         site=self.site)
     moderator = EntryCommentModerator(Entry)
     moderator.auto_moderate_comments = True
     moderator.spam_checker_backends = ()
     self.assertEquals(moderator.moderate(comment, self.entry, 'request'),
                       True)
     moderator.auto_moderate_comments = False
     self.assertEquals(moderator.moderate(comment, self.entry, 'request'),
                       False)
     moderator.spam_checker_backends = (
         'zinnia.spam_checker.backends.all_is_spam', )
     self.assertEquals(moderator.moderate(comment, self.entry, 'request'),
                       True)
Exemplo n.º 21
0
 def test_moderate(self):
     comment = comments.get_model().objects.create(
         comment='My Comment', user=self.author, is_public=True,
         content_object=self.entry, site=self.site)
     moderator = EntryCommentModerator(Entry)
     moderator.auto_moderate_comments = True
     moderator.spam_checker_backends = ()
     self.assertEquals(moderator.moderate(comment, self.entry, 'request'),
                       True)
     moderator.auto_moderate_comments = False
     self.assertEquals(moderator.moderate(comment, self.entry, 'request'),
                       False)
     moderator.spam_checker_backends = (
         'zinnia.spam_checker.backends.all_is_spam',)
     self.assertEquals(moderator.moderate(comment, self.entry, 'request'),
                       True)
Exemplo n.º 22
0
    def test_email_reply(self):
        comment = Comment.objects.create(comment='My Comment 1',
                                         user=self.author,
                                         is_public=True,
                                         content_object=self.entry,
                                         site=self.site)
        moderator = EntryCommentModerator(Entry)
        moderator.email_notification_reply = True
        moderator.email_reply(comment, self.entry, 'request')
        self.assertEquals(len(mail.outbox), 0)

        comment = Comment.objects.create(comment='My Comment 2',
                                         user_email='*****@*****.**',
                                         content_object=self.entry,
                                         is_public=True,
                                         site=self.site)
        moderator.email_reply(comment, self.entry, 'request')
        self.assertEquals(len(mail.outbox), 0)

        comment = Comment.objects.create(comment='My Comment 3',
                                         user_email='*****@*****.**',
                                         content_object=self.entry,
                                         is_public=True,
                                         site=self.site)
        moderator.email_reply(comment, self.entry, 'request')
        self.assertEquals(len(mail.outbox), 1)
        self.assertEquals(mail.outbox[0].to, [u'*****@*****.**'])

        comment = Comment.objects.create(comment='My Comment 4',
                                         user=self.author,
                                         is_public=True,
                                         content_object=self.entry,
                                         site=self.site)
        moderator.email_reply(comment, self.entry, 'request')
        self.assertEquals(len(mail.outbox), 2)
        self.assertEquals(mail.outbox[1].to,
                          [u'*****@*****.**', u'*****@*****.**'])
 def test_moderate(self):
     comment = comments.get_model().objects.create(
         comment="My Comment",
         user=self.author,
         is_public=True,
         content_object=self.entry,
         submit_date=timezone.now(),
         site=self.site,
     )
     moderator = EntryCommentModerator(Entry)
     moderator.auto_moderate_comments = True
     moderator.spam_checker_backends = ()
     self.assertTrue(moderator.moderate(comment, self.entry, "request"))
     moderator.auto_moderate_comments = False
     self.assertFalse(moderator.moderate(comment, self.entry, "request"))
     moderator.spam_checker_backends = ("zinnia.spam_checker.backends.all_is_spam",)
     self.assertTrue(moderator.moderate(comment, self.entry, "request"))
Exemplo n.º 24
0
 def test_moderate(self):
     comment = Comment.objects.create(comment='My Comment',
                                      user=self.author, is_public=True,
                                      content_object=self.entry,
                                      site=self.site)
     moderator = EntryCommentModerator(Entry)
     moderator.auto_moderate_comments = True
     self.assertEquals(moderator.moderate(comment, self.entry, 'request'),
                       True)
     moderator.auto_moderate_comments = False
     self.assertEquals(moderator.moderate(comment, self.entry, 'request'),
                       False)  # Because API key for Akismet is not defined
Exemplo n.º 25
0
 def test_do_email_authors_without_email(self):
     """
     https://github.com/Fantomas42/django-blog-zinnia/issues/145
     """
     comment = comments.get_model().objects.create(
         comment="My Comment", user=self.author, is_public=True, content_object=self.entry, site=self.site
     )
     self.assertEquals(len(mail.outbox), 0)
     moderator = EntryCommentModerator(Entry)
     moderator.email_authors = True
     moderator.mail_comment_notification_recipients = []
     contributor = Author.objects.create(username="******", email="*****@*****.**")
     self.entry.authors.add(contributor)
     moderator.do_email_authors(comment, self.entry, "request")
     self.assertEquals(len(mail.outbox), 1)
     self.assertEquals(mail.outbox[0].to, [u"*****@*****.**", u"*****@*****.**"])
     mail.outbox = []
     contributor.email = ""
     contributor.save()
     moderator.do_email_authors(comment, self.entry, "request")
     self.assertEquals(len(mail.outbox), 1)
     self.assertEquals(mail.outbox[0].to, [u"*****@*****.**"])
Exemplo n.º 26
0
    def test_do_email_reply(self):
        comment = comments.get_model().objects.create(
            comment='My Comment 1', user=self.author, is_public=True,
            content_object=self.entry, site=self.site)
        moderator = EntryCommentModerator(Entry)
        moderator.email_notification_reply = True
        moderator.mail_comment_notification_recipients = [
            u'*****@*****.**', u'*****@*****.**']
        moderator.do_email_reply(comment, self.entry, 'request')
        self.assertEquals(len(mail.outbox), 0)

        comment = comments.get_model().objects.create(
            comment='My Comment 2', user_email='*****@*****.**',
            content_object=self.entry, is_public=True, site=self.site)
        moderator.do_email_reply(comment, self.entry, 'request')
        self.assertEquals(len(mail.outbox), 0)

        comment = comments.get_model().objects.create(
            comment='My Comment 3', user_email='*****@*****.**',
            content_object=self.entry, is_public=True, site=self.site)
        moderator.do_email_reply(comment, self.entry, 'request')
        self.assertEquals(len(mail.outbox), 1)
        self.assertEquals(mail.outbox[0].bcc, [u'*****@*****.**'])

        comment = comments.get_model().objects.create(
            comment='My Comment 4', user=self.author, is_public=True,
            content_object=self.entry, site=self.site)
        moderator.do_email_reply(comment, self.entry, 'request')
        self.assertEquals(len(mail.outbox), 2)
        self.assertEquals(mail.outbox[1].bcc, [u'*****@*****.**',
                                               u'*****@*****.**'])
Exemplo n.º 27
0
    def test_do_email_reply(self):
        comment = comments.get_model().objects.create(
            comment='My Comment 1',
            user=self.author,
            is_public=True,
            content_object=self.entry,
            submit_date=timezone.now(),
            site=self.site)
        moderator = EntryCommentModerator(Entry)
        moderator.email_notification_reply = True
        moderator.mail_comment_notification_recipients = [
            '*****@*****.**', '*****@*****.**'
        ]
        moderator.do_email_reply(comment, self.entry, 'request')
        self.assertEqual(len(mail.outbox), 0)

        comment = comments.get_model().objects.create(
            comment='My Comment 2',
            user_email='*****@*****.**',
            content_object=self.entry,
            is_public=True,
            submit_date=timezone.now(),
            site=self.site)
        moderator.do_email_reply(comment, self.entry, 'request')
        self.assertEqual(len(mail.outbox), 0)

        comment = comments.get_model().objects.create(
            comment='My Comment 3',
            user_email='*****@*****.**',
            content_object=self.entry,
            is_public=True,
            submit_date=timezone.now(),
            site=self.site)
        moderator.do_email_reply(comment, self.entry, 'request')
        self.assertEqual(len(mail.outbox), 1)
        self.assertEqual(mail.outbox[0].bcc, ['*****@*****.**'])

        comment = comments.get_model().objects.create(
            comment='My Comment 4',
            user=self.author,
            is_public=True,
            content_object=self.entry,
            submit_date=timezone.now(),
            site=self.site)
        moderator.do_email_reply(comment, self.entry, 'request')
        self.assertEqual(len(mail.outbox), 2)
        #This suffers from the same ordering assumption issue
        self.assertEqual(set(mail.outbox[1].bcc),
                         set(['*****@*****.**', '*****@*****.**']))
Exemplo n.º 28
0
    def test_do_email_reply(self):
        comment = comments.get_model().objects.create(
            comment='My Comment 1', user=self.author, is_public=True,
            content_object=self.entry, submit_date=timezone.now(),
            site=self.site)
        moderator = EntryCommentModerator(Entry)
        moderator.email_notification_reply = True
        moderator.mail_comment_notification_recipients = [
            '*****@*****.**', '*****@*****.**']
        moderator.do_email_reply(comment, self.entry, 'request')
        self.assertEqual(len(mail.outbox), 0)

        comment = comments.get_model().objects.create(
            comment='My Comment 2', user_email='*****@*****.**',
            content_object=self.entry, is_public=True,
            submit_date=timezone.now(), site=self.site)
        moderator.do_email_reply(comment, self.entry, 'request')
        self.assertEqual(len(mail.outbox), 0)

        comment = comments.get_model().objects.create(
            comment='My Comment 3', user_email='*****@*****.**',
            content_object=self.entry, is_public=True,
            submit_date=timezone.now(), site=self.site)
        moderator.do_email_reply(comment, self.entry, 'request')
        self.assertEqual(len(mail.outbox), 1)
        self.assertEqual(mail.outbox[0].bcc, ['*****@*****.**'])

        comment = comments.get_model().objects.create(
            comment='My Comment 4', user=self.author, is_public=True,
            content_object=self.entry, submit_date=timezone.now(),
            site=self.site)
        moderator.do_email_reply(comment, self.entry, 'request')
        self.assertEqual(len(mail.outbox), 2)
        self.assertEqual(
            set(mail.outbox[1].bcc),
            set(['*****@*****.**', '*****@*****.**']))
Exemplo n.º 29
0
    def test_do_email_reply(self):
        comment = comments.get_model().objects.create(
            comment="My Comment 1", user=self.author, is_public=True, content_object=self.entry, site=self.site
        )
        moderator = EntryCommentModerator(Entry)
        moderator.email_notification_reply = True
        moderator.mail_comment_notification_recipients = [u"*****@*****.**", u"*****@*****.**"]
        moderator.do_email_reply(comment, self.entry, "request")
        self.assertEquals(len(mail.outbox), 0)

        comment = comments.get_model().objects.create(
            comment="My Comment 2",
            user_email="*****@*****.**",
            content_object=self.entry,
            is_public=True,
            site=self.site,
        )
        moderator.do_email_reply(comment, self.entry, "request")
        self.assertEquals(len(mail.outbox), 0)

        comment = comments.get_model().objects.create(
            comment="My Comment 3",
            user_email="*****@*****.**",
            content_object=self.entry,
            is_public=True,
            site=self.site,
        )
        moderator.do_email_reply(comment, self.entry, "request")
        self.assertEquals(len(mail.outbox), 1)
        self.assertEquals(mail.outbox[0].bcc, [u"*****@*****.**"])

        comment = comments.get_model().objects.create(
            comment="My Comment 4", user=self.author, is_public=True, content_object=self.entry, site=self.site
        )
        moderator.do_email_reply(comment, self.entry, "request")
        self.assertEquals(len(mail.outbox), 2)
        self.assertEquals(mail.outbox[1].bcc, [u"*****@*****.**", u"*****@*****.**"])