def test_api_page_patch_admin():
    """Can a user patch /api/v1/pages/<page_id> if admin"""
    app = create_ctfd()
    with app.app_context():
        gen_page(app.db, title="title", route="/route", content="content")
        with login_as_user(app, "admin") as client:
            with client.session_transaction() as sess:
                nonce = sess.get("nonce")
            r = client.patch(
                "/api/v1/pages/2",
                json={
                    "title": "Title",
                    "route": "/route",
                    "content": "content_edit",
                    "id": "2",
                    "nonce": nonce,
                    "auth_required": False,
                },
            )
            assert r.status_code == 200
            assert r.get_json()["data"]["content"] == "content_edit"
    destroy_ctfd(app)
Can a user patch /api/v1/pages/<page_id> if admin
tests/api/v1/test_pages.py