def emit_event(self): from turbion.bits import watchlist watchlist.emit_event( 'new_comment', post=self.post, filter_recipient=lambda user: user.email != self.created_by.email, comment=self, )
def test_new_comment(self): watchlist.subscribe( self.user, 'new_comment', self.post, email=True ) comment = self._create_comment() watchlist.emit_event('new_comment', post=self.post, comment=comment) self.assertEqual(queue_len(), 1)