vincbeck commented on code in PR #32292:
URL: https://github.com/apache/airflow/pull/32292#discussion_r1253198344
##########
tests/www/views/test_views_connection.py:
##########
@@ -62,11 +62,8 @@ def test_invalid_connection_id_trailing_blanks(admin_client,
session):
invalid_conn_id = "conn_id_with_trailing_blanks "
invalid_connection = {**CONNECTION, "conn_id": invalid_conn_id}
resp = admin_client.post("/connection/add", data=invalid_connection,
follow_redirects=True)
- check_content_in_response(
- f"The key '{invalid_conn_id}' has to be made of alphanumeric
characters, "
- + "dashes, dots and underscores exclusively",
- resp,
- )
+ # all the whitespaces get stripped off
+ check_content_in_response("Added Row", resp)
Review Comment:
You can fetch connections the same way it is done in the test
`test_duplicate_connection` in this file:
```python
response = {conn[0] for conn in session.query(Connection.conn_id).all()}
```
By doing this you fetch all connections, you just need then to check the
connection `conn_id_with_trailing_blanks` (with to blanks) is there
--
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]