code: def test_blocked_subdag_success(admin_client, running_subdag):
      """Test the /blocked endpoint works when a DAG is deleted.
  
      When a DAG is bagged, it is written to both DagModel and SerializedDagModel,
      but its subdags are only written to DagModel (without serialization). Thus,
      ``DagBag.get_dag(subdag_id)`` would raise ``SerializedDagNotFound`` if the
      subdag was not previously bagged in the dagbag (perhaps due to its root DAG
      being deleted). ``DagBag.get_dag()`` calls should catch the exception and
      properly handle this situation.
      """
      resp = admin_client.post(
          "/blocked", data={"dag_ids": [running_subdag.dag_id]}
      )
      assert resp.status_code == 200
      assert resp.json == [
          {
              "dag_id": running_subdag.dag_id,
              "active_dag_run": 1,
              "max_active_runs": 0,  # Default value for an unserialized DAG.
          },
      ]
  
file_path: airflow/tests/www/views/test_views_blocked.py
imports: from __future__ import annotations
  import pytest
  from airflow.models import DagModel
  from airflow.models.dagbag import DagBag
  from airflow.models.serialized_dag import SerializedDagModel
  from airflow.operators.empty import EmptyOperator
  from airflow.operators.subdag import SubDagOperator
  from airflow.utils import timezone
  from airflow.utils.session import create_session
  from airflow.utils.state import State
  from tests.test_utils.db import clear_db_runs
label_desc: Use image node_id 2 for calling a global function with example usage: test_blocked_subdag_success(admin_client, running_subdag) without return types