'Tests fitting a 2d polynomial model set with fixed parameters (#6135).'

def test_linear_fit_2d_model_set_fixed_parameters(self):

    init_model = models.Polynomial2D(degree=2, c1_0=[1, 2], c0_1=[(-0.5), 1], n_models=2, fixed={u'c1_0': True, u'c0_1': True})
    (x, y) = np.mgrid[0:5, 0:5]
    zz = np.array([(((1 + x) - (0.5 * y)) + ((0.1 * x) * x)), (((2 * x) + y) - ((0.2 * y) * y))])
    fitter = LinearLSQFitter()
    fitted_model = fitter(init_model, x, y, zz)
    assert_allclose(fitted_model(x, y, model_set_axis=False), zz, atol=1e-14)
