code: def test_externally_triggered_dagrun(self, dag_maker):
      TI = TaskInstance
  
      # Create the dagrun between two "scheduled" execution dates of the DAG
      execution_date = DEFAULT_DATE + timedelta(days=2)
      execution_ds = execution_date.strftime("%Y-%m-%d")
      execution_ds_nodash = execution_ds.replace("-", "")
  
      with dag_maker(schedule=timedelta(weeks=1)):
          task = EmptyOperator(
              task_id="test_externally_triggered_dag_context"
          )
      dag_maker.create_dagrun(
          run_type=DagRunType.SCHEDULED,
          execution_date=execution_date,
          external_trigger=True,
      )
      task.run(start_date=execution_date, end_date=execution_date)
  
      ti = TI(task=task, execution_date=execution_date)
      context = ti.get_template_context()
  
      # next_ds should be the execution date for manually triggered runs
      with pytest.deprecated_call():
          assert context["next_ds"] == execution_ds
      with pytest.deprecated_call():
          assert context["next_ds_nodash"] == execution_ds_nodash
  
imports: from __future__ import annotations
  from contextlib import suppress
  from datetime import timedelta
  from time import sleep
  import pytest
  from airflow import settings
  from airflow.exceptions import AirflowTaskTimeout
  from airflow.models import DagRun, TaskFail, TaskInstance
  from airflow.models.baseoperator import BaseOperator
  from airflow.operators.bash import BashOperator
  from airflow.operators.empty import EmptyOperator
  from airflow.operators.python import PythonOperator
  from airflow.utils.timezone import datetime
  from airflow.utils.types import DagRunType
  from tests.test_utils.db import clear_db_dags, clear_db_runs, clear_db_task_fail
label_desc: Use image node_id 7 for calling the TestCore obj's underlying member method code with example usage: obj.test_externally_triggered_dagrun(dag_maker) without return types