Пример #1
0
 def post(self): #done
     if self.request.body:
         topicDict = simplejson.loads(self.request.body)
         try:
             topic = DaoImpl.createTopic(topicDict)
             self.set_status(200)
             self.write(simplejson.dumps(Util.topicToDict(topic)))
         except Exception, e:
             self.set_status(400)
             self.write(error(e.__str__()))
Пример #2
0
 def testCreateTopic(self):
     """simple create. without links.
     """
     topicDict = {'title': 'topTit', 'speaker': 'topSpeak', 'author': 'topAuth'}
     topic = DaoImpl.createTopic(topicDict)
     self.assertEqual(topic.title, 'topTit2')