'Tests fitted multiple 2-D models simultaneously.'

def test_linear_fit_2d_model_set(self):

    init_model = models.Polynomial2D(degree=2, c0_0=[1, 1], n_models=2)
    x = np.arange(10)
    y = np.arange(10)
    z_expected = init_model(x, y, model_set_axis=False)
    assert (z_expected.shape == (2, 10))
    with NumpyRNGContext(_RANDOM_SEED):
        z = (z_expected + np.random.normal(0, 0.01, size=z_expected.shape))
    fitter = LinearLSQFitter()
    fitted_model = fitter(init_model, x, y, z)
    assert_allclose(fitted_model(x, y, model_set_axis=False), z_expected, rtol=0.1)
