def test_update_recipe(self):
    'Test updating a recipe'
    self.recipe = create_sample_recipe(name='Roast Dinner', description='Roasted potatoes and chicken with vegetables and gravy.')
    payload = {'name': 'Vegan Roast Dinner', 'description': 'Roasted potatoes and mushroom wellington with vegetables and gravy.'}
    response = self.client.patch(recipe_url(self.recipe.id), payload, format='json')
    self.recipe.refresh_from_db()
    self.assertEqual(response.status_code, status.HTTP_200_OK)
    self.assertEqual(self.recipe.name, response.data['name'])
    self.assertEqual(self.recipe.description, response.data['description'])
Test updating a recipe
def test_update_recipe(self):
    
    self.recipe = create_sample_recipe(name='Roast Dinner', description='Roasted potatoes and chicken with vegetables and gravy.')
    payload = {'name': 'Vegan Roast Dinner', 'description': 'Roasted potatoes and mushroom wellington with vegetables and gravy.'}
    response = self.client.patch(recipe_url(self.recipe.id), payload, format='json')
    self.recipe.refresh_from_db()
    self.assertEqual(response.status_code, status.HTTP_200_OK)
    self.assertEqual(self.recipe.name, response.data['name'])
    self.assertEqual(self.recipe.description, response.data['description'])