def test_disallowed_request_no_redirect(self):
        self.client.login(username="test2", password="password")

        self.assertRaises(
            PermissionDenied,
            self.client.get,
            reverse("test_view_x2",
                    kwargs={"obj_id": self.objs[0].id}),
            follow=True)
Handle the response to inaccessible views.
dataset/ETHPy150Open fp7-ofelia/ocf/expedient/src/python/expedient/common/permissions/tests/tests.py/TestRequests.test_disallowed_request_no_redirect--crossover with--dataset/ETHPy150Open flask-admin/flask-admin/flask_admin/base.py/BaseView.inaccessible_callback