예제 #1
0
def show(id):
    form = InterestIdForm(url={'id': id})
    if not form.validate():
        return json({'message': 'Validation Failed', 'errors': form.errors}, 422)

    data = Interest.find(form.id, app.auth.user.id)
    if data is False:
        return json({'message': 'Interest with given ID not found'}, 404)

    return json(data)
예제 #2
0
def show(id):
    form = InterestIdForm(url={'id': id})
    if not form.validate():
        return json({
            'message': 'Validation Failed',
            'errors': form.errors
        }, 422)

    data = Interest.find(form.id, app.auth.user.id)
    if data is False:
        return json({'message': 'Interest with given ID not found'}, 404)

    return json(data)
 def testFind(self):
     obj = Interest.find(1)
     self.assertEqual(obj.name, 'Photography')
     self.assertTrue(is_integer(obj.id))