def test_filter_recipes_by_ingredients(self):
    'returning recipes with specific ingredients'
    recipe1 = sample_recipe(user=self.user, title='Thai vegetables curry')
    recipe2 = sample_recipe(user=self.user, title='Aubergine with tahini')
    ingredient1 = sample_ingredient(user=self.user, name='Vegan')
    ingredient2 = sample_ingredient(user=self.user, name='Vegetarian')
    recipe1.ingredients.add(ingredient1)
    recipe2.ingredients.add(ingredient2)
    recipe3 = sample_recipe(self.user, title='Fish and chips')
    res = self.client.get(RECIPE_URL, {'ingredients': f'{ingredient1.id}, {ingredient2.id}'})
    serializer1 = RecipeSerializer(recipe1)
    serializer2 = RecipeSerializer(recipe2)
    serializer3 = RecipeSerializer(recipe3)
    self.assertIn(serializer1.data, res.data)
    self.assertIn(serializer2.data, res.data)
    self.assertNotIn(serializer3.data, res.data)
returning recipes with specific ingredients
def test_filter_recipes_by_ingredients(self):
    
    recipe1 = sample_recipe(user=self.user, title='Thai vegetables curry')
    recipe2 = sample_recipe(user=self.user, title='Aubergine with tahini')
    ingredient1 = sample_ingredient(user=self.user, name='Vegan')
    ingredient2 = sample_ingredient(user=self.user, name='Vegetarian')
    recipe1.ingredients.add(ingredient1)
    recipe2.ingredients.add(ingredient2)
    recipe3 = sample_recipe(self.user, title='Fish and chips')
    res = self.client.get(RECIPE_URL, {'ingredients': f'{ingredient1.id}, {ingredient2.id}'})
    serializer1 = RecipeSerializer(recipe1)
    serializer2 = RecipeSerializer(recipe2)
    serializer3 = RecipeSerializer(recipe3)
    self.assertIn(serializer1.data, res.data)
    self.assertIn(serializer2.data, res.data)
    self.assertNotIn(serializer3.data, res.data)