'Tests scheduling a dag scheduled for @once - should be scheduled the first time
it is called, and not scheduled the second.'

def test_schedule_dag_once(self):

    dag = DAG((TEST_DAG_ID + 'test_schedule_dag_once'))
    dag.schedule_interval = '@once'
    dag.add_task(models.BaseOperator(task_id='faketastic', owner='Also    fake', start_date=datetime(2015, 1, 2, 0, 0)))
    dag_run = jobs.SchedulerJob(**self.default_scheduler_args).create_dag_run(dag)
    dag_run2 = jobs.SchedulerJob(**self.default_scheduler_args).create_dag_run(dag)
    self.assertIsNotNone(dag_run)
    self.assertIsNone(dag_run2)
    dag.clear()
