def test_deepcopy_subset(adata, spmat: type):
    adata.obsp["arr"] = np.zeros((adata.n_obs, adata.n_obs))
    adata.obsp["spmat"] = spmat((adata.n_obs, adata.n_obs))

    adata = deepcopy(adata[:10].copy())

    assert isinstance(adata.obsp["arr"], np.ndarray)
    assert not isinstance(adata.obsp["arr"], ArrayView)
    np.testing.assert_array_equal(adata.obsp["arr"].shape, (10, 10))

    assert isinstance(adata.obsp["spmat"], spmat)
    assert not isinstance(
        adata.obsp["spmat"],
        SparseCSRView if spmat is sparse.csr_matrix else SparseCSCView,
    )
    np.testing.assert_array_equal(adata.obsp["spmat"].shape, (10, 10))
def test_admin_views(self):
        c = Client()
        c.login(username='testsuperuser', password='test1234')

        settingId = Setting.objects.all()[0].id # During tests, sometimes this is != 1
        themeId = Theme.objects.all()[0].id # During tests, sometimes this is != 1

        # Can access admin menu items
        admin_menu_items = ['/admin/app/setting/{}/change/'.format(settingId),
                            '/admin/app/theme/{}/change/'.format(themeId),
                            '/admin/',
                            '/admin/app/plugin/',
                            '/admin/auth/user/',
                            '/admin/auth/group/',
                            ]

        for url in admin_menu_items:
            res = c.get(url)
            self.assertEqual(res.status_code, status.HTTP_200_OK)

        # Cannot access dev tools (not in dev mode)
        settings.DEV = False
        self.assertEqual(c.get('/dev-tools/').status_code, status.HTTP_404_NOT_FOUND)
        settings.DEV = True