def test_delete_recipe(self):
    'Test deleting a recipe'
    self.recipe = create_sample_recipe(name='Carrot Cake', description='Sponge cake with hella carrots.')
    response = self.client.delete(recipe_url(self.recipe.id), format='json')
    self.assertEqual(response.status_code, status.HTTP_204_NO_CONTENT)
    self.assertFalse(Recipe.objects.all())
Test deleting a recipe
def test_delete_recipe(self):
    
    self.recipe = create_sample_recipe(name='Carrot Cake', description='Sponge cake with hella carrots.')
    response = self.client.delete(recipe_url(self.recipe.id), format='json')
    self.assertEqual(response.status_code, status.HTTP_204_NO_CONTENT)
    self.assertFalse(Recipe.objects.all())