class_docstr: Unit tests for SerializedDagModel.
class_docstr_tok: ["Unit","tests","for","SerializedDagModel","."]
docstr: DAGs can be removed from database.
docstr_tok: ["DAGs","can","be","removed","from","database","."]
code: def test_remove_dags_by_id(self):
      """DAGs can be removed from database."""
      example_dags_list = list(self._write_example_dags().values())
      # Remove SubDags from the list as they are not stored in DB in a separate row
      # and are directly added in Json blob of the main DAG
      filtered_example_dags_list = [
          dag for dag in example_dags_list if not dag.is_subdag
      ]
      # Tests removing by dag_id.
      dag_removed_by_id = filtered_example_dags_list[0]
      SDM.remove_dag(dag_removed_by_id.dag_id)
      assert not SDM.has_dag(dag_removed_by_id.dag_id)
  
imports: from __future__ import annotations
  from unittest import mock
  import pendulum
  import pytest
  import airflow.example_dags
  from airflow.datasets import Dataset
  from airflow.models.dag import DAG
  from airflow.models.dagbag import DagBag
  from airflow.models.dagcode import DagCode
  from airflow.models.serialized_dag import SerializedDagModel
  from airflow.operators.bash import BashOperator
  from airflow.serialization.serialized_objects import SerializedDAG
  from airflow.settings import json
  from airflow.utils.hashlib_wrapper import md5
  from airflow.utils.session import create_session
  from tests.test_utils import db
  from tests.test_utils.asserts import assert_queries_count
label_desc: Use image node_id 8 for calling the TestSerializedDagModel obj's underlying member method code with example usage: obj.test_remove_dags_by_id() without return types