"""
        Test that DagModel.has_import_error is set to false if no import errors.
        """
        dag = DAG(dag_id="test_has_import_error", start_date=DEFAULT_DATE)
        EmptyOperator(task_id="dummy", dag=dag, owner="airflow")
        session = settings.Session()
        dag.clear()
        DAG.bulk_write_to_db([dag], session=session)
        model = session.get(DagModel, dag.dag_id)
        assert not model.has_import_errors
        
        model.has_import_errors = True
        session.merge(model)
        session.flush()
        model = session.get(DagModel, dag.dag_id)
        
        assert model.has_import_errors
        
        DAG.bulk_write_to_db([dag])
        model = session.get(DagModel, dag.dag_id)
        
        assert not model.has_import_errors
        session.close()
    def test_bulk_write_to_db_datasets(self):