コード例 #1
0
ファイル: comment.py プロジェクト: dlowe/pootpoot
 def _data(self):
     """submit a new comment"""
     new_comment = comment.submit(
           author=self.request.get('author'),
           content=self.request.get('content'),
           interpretation_key_string=self.request.get('interpretation_key_string'))
     return new_comment
コード例 #2
0
ファイル: test_comment.py プロジェクト: dlowe/pootpoot
    def test_submit(self):
        i = interpretation.submit(title=u"untitled", author="Anonymous", type=interpretation.T_TEXT, content="fnord")

        self.assertEquals(comment.count(i), 0)

        c = comment.submit(author="Anonymous", content="yadda", interpretation_key_string=str(i.key()))

        self.assertEquals(comment.count(i), 1)

        l = comment.list_comments(str(i.key()))
        self.assertEquals(len(l), 1)
        self.assertEquals(l[0].is_active, True)
        self.assertEquals(l[0].author, "Anonymous")
        self.assertEquals(l[0].content, "yadda")