예제 #1
0
파일: main.py 프로젝트: a85/doublespeak
 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
파일: DemoTest.py 프로젝트: a85/doublespeak
 def testCreateTopic(self):
     """simple create. without links.
     """
     topicDict = {'title': 'topTit', 'speaker': 'topSpeak', 'author': 'topAuth'}
     topic = DaoImpl.createTopic(topicDict)
     self.assertEqual(topic.title, 'topTit2')