def METHOD_NAME(model_class, mode):
    """
    Test if the sum of all pixels corresponds nearly to the integral.
    """
    if model_class == Box1D and mode == "center":
        pytest.skip("Non integrating mode. Skip integral test.")
    parameters = models_1D[model_class]
    model = create_model(model_class, parameters)
    values = discretize_model(model, models_1D[model_class]["x_lim"], mode=mode)
    assert_allclose(values.sum(), models_1D[model_class]["integral"], atol=0.0001)