

def test_inaccessible_callback():
    app = Flask(__name__)
    admin = base.Admin(app)
    view = MockView()
    admin.add_view(view)
    client = app.test_client()
    view.allow_access = False
    view.inaccessible_callback = (lambda *args, **kwargs: abort(418))
    rv = client.get('/admin/mockview/')
    eq_(rv.status_code, 418)

dataset/ETHPy150Open mrjoes/flask-admin/flask_admin/tests/test_base.py test_inaccessible_callback/original