def test_retrieve_recipe(self):
    'Test retrieving a list of recipe'
    sample_recipe(user=self.user)
    sample_recipe(user=self.user)
    res = self.client.get(RECIPE_URL)
    recipes = Recipe.objects.all().order_by('-id')
    serializer = RecipeSerializer(recipes, many=True)
    self.assertEqual(res.status_code, status.HTTP_200_OK)
    self.assertEqual(res.data, serializer.data)
Test retrieving a list of recipe
def test_retrieve_recipe(self):
    
    sample_recipe(user=self.user)
    sample_recipe(user=self.user)
    res = self.client.get(RECIPE_URL)
    recipes = Recipe.objects.all().order_by('-id')
    serializer = RecipeSerializer(recipes, many=True)
    self.assertEqual(res.status_code, status.HTTP_200_OK)
    self.assertEqual(res.data, serializer.data)