ephraimbuddy commented on a change in pull request #20485:
URL: https://github.com/apache/airflow/pull/20485#discussion_r778013667



##########
File path: tests/api_connexion/endpoints/test_dag_run_endpoint.py
##########
@@ -163,6 +163,35 @@ def _create_test_dag_run(self, state='running', 
extra_dag=False, commit=True):
                 session.add_all(dags)
         return dag_runs
 
+    def _create_test_dag_run_with_queued(self, commit=True):
+        dag_runs = []
+        dags = [DagModel(dag_id="TEST_DAG_ID")]
+        dagrun_model_1 = DagRun(
+            dag_id="TEST_DAG_ID",
+            run_id="TEST_DAG_RUN_ID_1",
+            run_type=DagRunType.MANUAL,
+            execution_date=timezone.parse(self.default_time),
+            start_date=timezone.parse(self.default_time),
+            external_trigger=True,
+            state='running',
+        )
+        dag_runs.append(dagrun_model_1)
+        dagrun_model_2 = DagRun(
+            dag_id="TEST_DAG_ID",
+            run_id="TEST_DAG_RUN_ID_2",
+            run_type=DagRunType.MANUAL,
+            execution_date=timezone.parse(self.default_time_2),
+            start_date=timezone.parse(self.default_time),
+            external_trigger=True,
+            state='queued',
+        )
+        dag_runs.append(dagrun_model_2)
+        if commit:
+            with create_session() as session:
+                session.add_all(dag_runs)
+                session.add_all(dags)
+        return dag_runs

Review comment:
       What do you think about changing the method _create_test_dag_run to 
avoid that, if it's possible let's do it instead




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to