Esempio n. 1
0
    def test_get_moderation_queue(self):
        thread, a1, a2, tempdir = self._create_comments()

        # let's check the moderation queue
        comments = CommentsDB(tempdir)

        # let's moderate our articles
        cuids = [c.uuid for c in comments.get_moderation_queue()]
        comments.activate_comment(cuids[0])
        comments.reject_comment(cuids[1])

        # noop
        comments.activate_comment("xxx")

        # the queue should be empty now
        self.assertEqual(len(list(comments.get_moderation_queue())), 0)

        # let's check we have 3 active comments now in that thread
        thread.load()
        comments = thread.get_comments()
        self.assertEqual(len(comments), 3)
Esempio n. 2
0
def reject_comment(comment_id):
    comments_dir = app._config['henet']['comments_dir']
    database = CommentsDB(comments_dir)
    database.reject_comment(comment_id)
    redirect('/comments')