def post(self): try: fb_obj = json.loads(self.request.body) fb = feedback.create(fb_obj['comment'], fb_obj['name'], fb_obj['email']) self.respond_created(feedback_uri(fb)) except ValueError: self.respond_bad_request('Request did not contain valid JSON')
def setup(self): self.fb1 = feedback.create('William', '*****@*****.**', 'This is a test comment') self.fb2 = feedback.create('Blaine', '*****@*****.**', 'This is another test comment')