'Test that the scheduler respects start_dates, even when DAGS have run'

def test_scheduler_start_date(self):

    dag_id = u'test_start_date_scheduling'
    dag = self.dagbag.get_dag(dag_id)
    dag.clear()
    self.assertTrue((dag.start_date > DEFAULT_DATE))
    scheduler = SchedulerJob(dag_id, num_runs=2, **self.default_scheduler_args)
    scheduler.run()
    session = settings.Session()
    self.assertEqual(len(session.query(TI).filter((TI.dag_id == dag_id)).all()), 0)
    backfill = BackfillJob(dag=dag, start_date=DEFAULT_DATE, end_date=DEFAULT_DATE)
    backfill.run()
    session = settings.Session()
    self.assertEqual(len(session.query(TI).filter((TI.dag_id == dag_id)).all()), 1)
    scheduler = SchedulerJob(dag_id, num_runs=2, **self.default_scheduler_args)
    scheduler.run()
    session = settings.Session()
    self.assertEqual(len(session.query(TI).filter((TI.dag_id == dag_id)).all()), 1)
