title: How to test airflow dag in unittest?
body: <p>I am trying to test a dag with more than one task in the test environment. I was able to test single task associated with the dag but I want to create several tasks in dag and kick of the first task.
  For testing one task in a dag I am using </p>
  
  <blockquote>
    <p><code>task1.run()</code></p>
  </blockquote>
  
  <p>which is getting executed. But, the same is not working when I have many tasks one after another in downstream of a dag.</p>
  
  <pre><code>from airflow import DAG
  from airflow.operators.bash_operator import BashOperator
  from datetime import datetime, timedelta
  
  
  default_args = {
  'owner': 'airflow',
  'depends_on_past': False,
  'start_date': datetime(2015, 6, 1),
  'email': ['airflow@example.com'],
  'email_on_failure': False,
  'email_on_retry': False,
  'retries': 1,
  'retry_delay': timedelta(minutes=5),
  # 'queue': 'bash_queue',
  # 'pool': 'backfill',
  # 'priority_weight': 10,
  # 'end_date': datetime(2016, 1, 1),
  }
  
  dag = DAG('tutorial', default_args=default_args)
  
  # t1, t2 and t3 are examples of tasks created by instantiating operators
  t1 = BashOperator(
  task_id='print_date',
  bash_command='date',
  dag=dag)
  
  t2 = BashOperator(
  task_id='sleep',
  bash_command='sleep 5',
  retries=3,
  dag=dag)
  
  t2.set_upstream(t1)
  
  t1.run() # It is executing just first task.
  </code></pre>
  
  <p>In order to run second task I have to run using t2.run() which I don't want as I am designing a DAG. How to achieve this?</p>