mik-laj edited a comment on issue #8505:
URL: https://github.com/apache/airflow/pull/8505#issuecomment-617467054
We can create context - `catch_jinja_params()` (similar to `count_queries`,
`contextlib.redirect_stdout(io.StringIO())` ) that will help us introduce these
assertions into current tests. Thanks to this, we will still have assertions
for the HTML code, but also more precise for the Jinja params only.
```python
class TestVersionView(TestBase):
def test_version(self):
with catch_jinja_params() as jinja_params:
resp = self.client.get('version', data=dict(
username='test',
password='test'
), follow_redirects=True)
self.check_content_in_response('Version Info', resp)
self.assertEqual(jinja_params.template_name, 'airflow/version.html')
self.assertEqual(jinja_params.params, dict(
airflow_version=version.version,
git_version=mock.ANY,
scheduler_job=mock.ANY,
title='Version Info'
))
```
However, I only wanted to present the general concept in this PR.
----------------------------------------------------------------
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]