def test_should_return_400_when_sent_extra_fields(self) -> None:
    recipe = RecipeFactory(ingredients=None)
    data = RecipeSerializer(recipe).data
    data['foo'] = 'bar'
    response = self.api_client.put(f'/recipes/{recipe.id}', data, format='json')
    assert_that(response.status_code).is_equal_to(status.HTTP_400_BAD_REQUEST)
def test_should_return_400_when_sent_extra_fields(self) -> None:
    recipe = RecipeFactory(ingredients=None)
    data = RecipeSerializer(recipe).data
    data['foo'] = 'bar'
    response = self.api_client.put(f'/recipes/{recipe.id}', data, format='json')
    assert_that(response.status_code).is_equal_to(status.HTTP_400_BAD_REQUEST)