def test_get_recipes(self, client, recipes, ingredients):
        res = client.get(
            utils.urlize(self.endpoint, ingredients[0]['id'], 'recipes')
        )
        for recipe in res.data['recipes']:
            utils.unorder_recipe(recipe)

        assert res.status_code == 200
        assert res.data == {'recipes': [utils.unorder_recipe(recipes[0])]}
    def test_list(self, client, recipes):
        unorder = lambda rcps: [utils.unorder_recipe(rcp) for rcp in rcps]

        super(TestRecipes, self).test_list(
            client, {'recipes': unorder(recipes)},
            lambda d: unorder(d['recipes'])
        )
 def test_get_recipes(self, client, recipes, ingredients):
     expected = {'recipes': [utils.unorder_recipe(recipes[0])]}
     id =  ingredients[0]['id']
     super(TestIngredients, self).test_get_recipes(client, id, expected)
 def test_get(self, client, recipe):
     super(TestRecipes, self).test_get(
         client, recipe['id'], {'recipe': utils.unorder_recipe(recipe)},
         lambda d: utils.unorder_recipe(d['recipe'])
     )
 def test_get_recipes(self, client, recipes, utensils):
     expected = {'recipes': [utils.unorder_recipe(recipes[0])]}
     id =  utensils[0]['id']
     super(TestUtensils, self).test_get_recipes(client, id, expected)