"""
        Test if the schedule_interval will be auto aligned with the start_date
        such that if the start_date coincides with the schedule the first
        execution_date will be start_date, otherwise it will be start_date +
        interval.
        """
        dag = DAG(
            dag_id="test_scheduler_auto_align_1",
            start_date=timezone.datetime(2016, 1, 1, 10, 10, 0),
            schedule="4 5 * * *",
        )
        EmptyOperator(task_id="dummy", dag=dag, owner="airflow")
        next_info = dag.next_dagrun_info(None)
        assert next_info and next_info.logical_date == timezone.datetime(2016, 1, 2, 5, 4)
        dag = DAG(
            dag_id="test_scheduler_auto_align_2",
            start_date=timezone.datetime(2016, 1, 1, 10, 10, 0),
            schedule="10 10 * * *",
        )
        EmptyOperator(task_id="dummy", dag=dag, owner="airflow")
        next_info = dag.next_dagrun_info(None)
        assert next_info and next_info.logical_date == timezone.datetime(2016, 1, 1, 10, 10)
    def test_next_dagrun_after_not_for_subdags(self):
        """
        Test the subdags are never marked to have dagruns created, as they are
        handled by the SubDagOperator, not the scheduler
        """
        def subdag(parent_dag_name, child_dag_name, args):