code: def test_database_download_for_immutable():
      with make_app_client(is_immutable=True) as client:
          assert not client.ds.databases["fixtures"].is_mutable
          # Regular page should have a download link
          response = client.get("/fixtures")
          soup = Soup(response.content, "html.parser")
          assert len(soup.findAll("a", {"href": re.compile(r"\.db$")}))
          # Check we can actually download it
          download_response = client.get("/fixtures.db")
          assert download_response.status_code == 200
          # Check the content-length header exists
          assert "content-length" in download_response.headers
          content_length = download_response.headers["content-length"]
          assert content_length.isdigit()
          assert int(content_length) > 100
          assert "content-disposition" in download_response.headers
          assert (
              download_response.headers["content-disposition"]
              == 'attachment; filename="fixtures.db"'
          )
          assert (
              download_response.headers["transfer-encoding"]
              == "chunked"
          )
          # ETag header should be present and match db.hash
          assert "etag" in download_response.headers
          etag = download_response.headers["etag"]
          assert etag == '"{}"'.format(
              client.ds.databases["fixtures"].hash
          )
          # Try a second download with If-None-Match: current-etag
          download_response2 = client.get(
              "/fixtures.db", if_none_match=etag
          )
          assert download_response2.body == b""
          assert download_response2.status == 304
  
imports: from bs4 import BeautifulSoup
  from datasette.utils import allowed_pragmas
  from .fixtures import app_client, app_client_base_url_prefix, app_client_shorter_time_limit, app_client_two_attached_databases, make_app_client, METADATA
  from .utils import assert_footer_links, inner_html
  import copy
  import json
  import pathlib
  import pytest
  import re
  import urllib.parse
label_desc: Use image node_id 8 for calling a global function with example usage: test_database_download_for_immutable() without return types