'Test the derivative of a model by comparing results with an estimated
derivative.'

@pytest.mark.skipif(u'not    HAS_SCIPY')
def test_deriv_1D(self, model_class, test_parameters):

    x_lim = test_parameters[u'x_lim']
    if (model_class.fit_deriv is None):
        pytest.skip(u'Derivative    function    is    not    defined    for    model.')
    if issubclass(model_class, PolynomialBase):
        pytest.skip(u'Skip    testing    derivative    of    polynomials.')
    if (u'log_fit' in test_parameters):
        if test_parameters[u'log_fit']:
            x = np.logspace(x_lim[0], x_lim[1], self.N)
    else:
        x = np.linspace(x_lim[0], x_lim[1], self.N)
    parameters = test_parameters[u'parameters']
    model_with_deriv = create_model(model_class, test_parameters, use_constraints=False)
    model_no_deriv = create_model(model_class, test_parameters, use_constraints=False)
    rsn = np.random.RandomState(1234567890)
    n = ((0.1 * parameters[0]) * (rsn.rand(self.N) - 0.5))
    data = (model_with_deriv(x) + n)
    fitter_with_deriv = fitting.LevMarLSQFitter()
    new_model_with_deriv = fitter_with_deriv(model_with_deriv, x, data)
    fitter_no_deriv = fitting.LevMarLSQFitter()
    new_model_no_deriv = fitter_no_deriv(model_no_deriv, x, data, estimate_jacobian=True)
    utils.assert_allclose(new_model_with_deriv.parameters, new_model_no_deriv.parameters, atol=0.15)
