コード例 #1
0
ファイル: models.py プロジェクト: pombredanne/turbion
    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,
        )
コード例 #2
0
ファイル: tests.py プロジェクト: pombredanne/turbion
    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)