### Body

Add unit test for changes in https://github.com/apache/airflow/pull/17305

### Committer

- [X] I acknowledge that I am a maintainer/committer of the Apache Airflow project.
tests/jobs/test_backfill_job.py
ti2 = TI(task, dr2.execution_date)
            ti1.refresh_from_db()
            ti2.refresh_from_db()
            ti1.state = state
            ti2.state = state
            dr1_tis.append(ti1)
            dr2_tis.append(ti2)
            session.merge(ti1)
            session.merge(ti2)
            session.commit()
        assert 2 == job.reset_state_for_orphaned_tasks()
        for ti in dr1_tis + dr2_tis:
            ti.refresh_from_db()
        
        for state, ti in zip(states, dr1_tis):
            if state in states_to_reset:
                assert ti.state is None
            else:
                assert state == ti.state
        
        for state, ti in zip(states, dr2_tis):
            assert state == ti.state
        for state, ti in zip(states, dr1_tis):
            ti.state = state
        session.commit()
        job.reset_state_for_orphaned_tasks(filter_by_dag_run=dr1, session=session)
        
        for state, ti in zip(states, dr2_tis):
            assert state == ti.state
    def test_reset_orphaned_tasks_specified_dagrun(self, session, dag_maker):