def test_full_update_recipe(self):
    'Test update recipe with put'
    recipe = sample_recipe(user=self.user)
    recipe.tags.add(sample_tag(user=self.user))
    payload = {'title': 'Spaghetti Carbonara', 'time_minutes': 25, 'price': 5.0}
    url = detail_url(recipe.id)
    self.client.put(url, payload)
    recipe.refresh_from_db()
    self.assertEqual(recipe.title, payload['title'])
    self.assertEqual(recipe.time_minutes, payload['time_minutes'])
    self.assertEqual(recipe.price, payload['price'])
    tags = recipe.tags.all()
    self.assertEqual(len(tags), 0)
Test update recipe with put
def test_full_update_recipe(self):
    
    recipe = sample_recipe(user=self.user)
    recipe.tags.add(sample_tag(user=self.user))
    payload = {'title': 'Spaghetti Carbonara', 'time_minutes': 25, 'price': 5.0}
    url = detail_url(recipe.id)
    self.client.put(url, payload)
    recipe.refresh_from_db()
    self.assertEqual(recipe.title, payload['title'])
    self.assertEqual(recipe.time_minutes, payload['time_minutes'])
    self.assertEqual(recipe.price, payload['price'])
    tags = recipe.tags.all()
    self.assertEqual(len(tags), 0)