def test_should_return_400_when_missing_required_field(self) -> None:
    recipe = RecipeFactory(ingredients=None)
    data = RecipeSerializer(recipe).data
    del data['name']
    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_missing_required_field(self) -> None:
    recipe = RecipeFactory(ingredients=None)
    data = RecipeSerializer(recipe).data
    del data['name']
    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)