You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2020/03/09 19:08:30 UTC

[GitHub] [airflow] kaxil commented on a change in pull request #7633: [AIRFLOW-6989] Store UnRenderedTemplateFields in SerializedDag table

kaxil commented on a change in pull request #7633: [AIRFLOW-6989] Store UnRenderedTemplateFields in SerializedDag table
URL: https://github.com/apache/airflow/pull/7633#discussion_r389902050
 
 

 ##########
 File path: tests/www/test_views.py
 ##########
 @@ -1922,6 +1922,24 @@ def test_rendered_view(self, get_dag_function):
         resp = self.client.get(url, follow_redirects=True)
         self.check_content_in_response("testdag__testtask__20200301", resp)
 
+    @mock.patch('airflow.www.views.STORE_SERIALIZED_DAGS', True)
+    @mock.patch('airflow.models.taskinstance.STORE_SERIALIZED_DAGS', True)
+    @mock.patch('airflow.www.views.dagbag.get_dag')
+    def test_rendered_view_for_unexecuted_tis(self, get_dag_function):
+        """
+        Test that the Rendered View is able to show rendered values
+        even for TIs that have not yet executed
+        """
+        get_dag_function.return_value = SerializedDagModel.get(self.dag.dag_id).dag
+
+        self.assertEqual(self.task.bash_command, '{{ task_instance_key_str }}')
+
+        url = ('rendered?task_id=testtask&dag_id=testdag&execution_date={}'
+               .format(self.percent_encode(self.default_date)))
+
+        resp = self.client.get(url, follow_redirects=True)
+        self.check_content_in_response("testdag__testtask__20200301", resp)
 
 Review comment:
   It will error with the following message:
   
   ![image](https://user-images.githubusercontent.com/8811558/76248463-4811b780-6239-11ea-844f-f03a60d6b250.png)
   

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services