Ejemplo n.º 1
0
    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")
Ejemplo n.º 2
0
 def _data(self):
     """fetch list of matching comments"""
     if not self.request.get('interpretation_key_string'):
         raise api_request_handler.MalformedRequest()
     return comment.list_comments(self.request.get('interpretation_key_string'))