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 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))