def get(self): args = parser.parse_args() if not args.get('user_id'): raise BadRequest if len(args.get('user_id')) == 1: return get_recipes_for_user(args['user_id'][0]) else: return get_recipes_for_users(args['user_id'])
def test_user_recipes(self): self.assertEqual(len(get_recipes_for_user(1)), 1)