code: def test_hook_skip_csrf(app_client):
      cookie = app_client.actor_cookie({"id": "test"})
      csrf_response = app_client.post(
          "/post/",
          post_data={"this is": "post data"},
          csrftoken_from=True,
          cookies={"ds_actor": cookie},
      )
      assert csrf_response.status_code == 200
      missing_csrf_response = app_client.post(
          "/post/",
          post_data={"this is": "post data"},
          cookies={"ds_actor": cookie},
      )
      assert missing_csrf_response.status_code == 403
      # But "/skip-csrf" should allow
      allow_csrf_response = app_client.post(
          "/skip-csrf",
          post_data={"this is": "post data"},
          cookies={"ds_actor": cookie},
      )
      assert (
          allow_csrf_response.status_code == 405
      )  # Method not allowed
      # /skip-csrf-2 should not
      second_missing_csrf_response = app_client.post(
          "/skip-csrf-2",
          post_data={"this is": "post data"},
          cookies={"ds_actor": cookie},
      )
      assert second_missing_csrf_response.status_code == 403
  
imports: from bs4 import BeautifulSoup
  from .fixtures import app_client, app_client, make_app_client, TABLES, TEMP_PLUGIN_SECRET_FILE, PLUGINS_DIR, TestClient
  from click.testing import CliRunner
  from datasette.app import Datasette
  from datasette import cli, hookimpl, Permission
  from datasette.filters import FilterArguments
  from datasette.plugins import get_plugins, DEFAULT_PLUGINS, pm
  from datasette.utils.sqlite import sqlite3
  from datasette.utils import CustomRow, StartupError
  from jinja2.environment import Template
  from jinja2 import ChoiceLoader, FileSystemLoader
  import base64
  import importlib
  import json
  import os
  import pathlib
  import re
  import textwrap
  import pytest
  import urllib
label_desc: Use image node_id 17 for calling a global function with example usage: test_hook_skip_csrf(app_client) without return types