'Make sure that a proper value is returned when a dagrun has no task instances'

def test_get_task_instance_on_empty_dagrun(self):

    dag = DAG(dag_id=u'test_get_task_instance_on_empty_dagrun', start_date=datetime.datetime(2017, 1, 1))
    dag_task1 = ShortCircuitOperator(task_id=u'test_short_circuit_false', dag=dag, python_callable=(lambda : False))
    session = settings.Session()
    now = datetime.datetime.now()
    dag_run = models.DagRun(dag_id=dag.dag_id, run_id=(u'manual__' + now.isoformat()), execution_date=now, start_date=now, state=State.RUNNING, external_trigger=False)
    session.add(dag_run)
    session.commit()
    ti = dag_run.get_task_instance(u'test_short_circuit_false')
    self.assertEqual(None, ti)
