def test_login_required_to_view_ingredients(self):
    'Test that authentication is needed to view the ingredients.'
    res = self.client.get(INGREDIENTS_URL)
    self.assertEqual(res.status_code, status.HTTP_401_UNAUTHORIZED)
Test that authentication is needed to view the ingredients.
def test_login_required_to_view_ingredients(self):
    
    res = self.client.get(INGREDIENTS_URL)
    self.assertEqual(res.status_code, status.HTTP_401_UNAUTHORIZED)