code: def test_has_access_dag_entities_when_unauthorized(
      self, mock_get_auth_manager, app, dag_access_entity
  ):
      auth_manager = Mock()
      auth_manager.batch_is_authorized_dag.return_value = False
      mock_get_auth_manager.return_value = auth_manager
      items = [Mock(dag_id="dag_1"), Mock(dag_id="dag_2")]
  
      with app.test_request_context():
          result = auth.has_access_dag_entities(
              "GET", dag_access_entity
          )(self.method_test)(None, items)
  
      mock_call.assert_not_called()
      assert result.headers["Location"] == "/home"
  
imports: from __future__ import annotations
  from unittest.mock import Mock, patch
  import pytest
  import airflow.www.auth
  from airflow.auth.managers.models.resource_details import DagAccessEntity
  from airflow.exceptions import RemovedInAirflow3Warning
  from airflow.models import Connection, Pool, Variable
  from airflow.security import permissions
  from airflow.settings import json
  from airflow.www.auth import has_access
  from tests.test_utils.api_connexion_utils import create_user_scope
label_desc: Use image node_id 4 for calling the TestHasAccessDagEntities obj's underlying member method code with example usage: obj.test_has_access_dag_entities_when_unauthorized(mock_get_auth_manager, app, dag_access_entity) without return types