def test_task_instance_link(self): from airflow.www.app import cached_appbuilder with cached_appbuilder(testing=True).app.test_request_context(): html = str(utils.task_instance_link({ 'dag_id': '<a&1>', 'task_id': '<b2>', 'execution_date': datetime.now() })) self.assertIn('%3Ca%261%3E', html) self.assertIn('%3Cb2%3E', html) self.assertNotIn('<a&1>', html) self.assertNotIn('<b2>', html)
def test_task_instance_link(self): from airflow.www.app import cached_app with cached_app(testing=True).test_request_context(): html = str( utils.task_instance_link({ 'dag_id': '<a&1>', 'task_id': '<b2>', 'execution_date': datetime.now() })) assert '%3Ca%261%3E' in html assert '%3Cb2%3E' in html assert '<a&1>' not in html assert '<b2>' not in html