kaxil edited a comment on issue #8505:
URL: https://github.com/apache/airflow/pull/8505#issuecomment-617505280


   I like this, I tested it with:
   
   ```python
       @mock.patch('airflow.www.views.dagbag.get_dag')
       def test_extra_link_in_gantt_view(self, get_dag_function):
           from tests.test_utils.mock_operators import Dummy2TestOperator
           dag = DAG('dag', start_date=self.default_date)
           Dummy2TestOperator(task_id="some_dummy_task_2", dag=dag)
   
           get_dag_function.return_value = dag
   
           exec_date = dates.days_ago(2)
           start_date = datetime(2020, 4, 10, 2, 0, 0)
           end_date = exec_date + timedelta(seconds=30)
   
           with create_session() as session:
               for task in dag.tasks:
                   ti = TaskInstance(task=task, execution_date=exec_date, 
state="success")
                   ti.start_date = start_date
                   ti.end_date = end_date
                   session.add(ti)
   
           url = 'gantt?dag_id={}&execution_date={}'.format(self.dag.dag_id, 
exec_date)
           with catch_jinja_params() as jinja_params:
               self.client.get(url, follow_redirects=True)
   
           self.assertEqual(jinja_params.template_name, 'airflow/gantt.html')
           self.assertCountEqual(
               jinja_params.template_params['data']['tasks'][0]['extraLinks'],
               ['airflow', 'github'])
   ```
   
   and works fine. However, I have 1 question: Do we lose any Airflow related 
args/customizations because of `side_effect=BaseView.render_template` ??


----------------------------------------------------------------
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.

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


Reply via email to