code: def test_view_query(allow, expected_anon, expected_auth):
      with make_app_client(
          config={
              "databases": {
                  "fixtures": {
                      "queries": {
                          "q": {"sql": "select 1 + 1", "allow": allow}
                      }
                  }
              }
          }
      ) as client:
          anon_response = client.get("/fixtures/q")
          assert expected_anon == anon_response.status
          if allow and anon_response.status == 200:
              # Should be no padlock
              assert "🔒</h1>" not in anon_response.text
          auth_response = client.get(
              "/fixtures/q",
              cookies={"ds_actor": client.actor_cookie({"id": "root"})},
          )
          assert expected_auth == auth_response.status
          if allow and expected_anon == 403 and expected_auth == 200:
              assert ">fixtures: q 🔒</h1>" in auth_response.text
  
imports: import collections
  from datasette.app import Datasette
  from datasette.cli import cli
  from datasette.default_permissions import restrictions_allow_action
  from .fixtures import app_client, assert_permissions_checked, make_app_client
  from click.testing import CliRunner
  from bs4 import BeautifulSoup
  import copy
  import json
  from pprint import pprint
  import pytest_asyncio
  import pytest
  import re
  import time
  import urllib
label_desc: Use image node_id 8 for calling a global function with example usage: test_view_query(allow, expected_anon, expected_auth) without return types