amoghrajesh commented on code in PR #32292:
URL: https://github.com/apache/airflow/pull/32292#discussion_r1255276863


##########
tests/www/views/test_views_connection.py:
##########
@@ -58,16 +58,23 @@ def test_create_connection(admin_client, session):
     _check_last_log(session, dag_id=None, event="connection.create", 
execution_date=None)
 
 
-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,
+def test_connection_id_with_trailing_blanks(admin_client, session):
+    conn_id_with_blanks = "conn_id_with_trailing_blanks   "
+
+    conn = Connection(
+        conn_id=conn_id_with_blanks,
+        conn_type="Google Cloud",
     )
 
+    with create_session() as session:
+        session.query(Connection).delete()
+        session.add(conn)
+        session.commit()
+
+    response = {conn[0] for conn in session.query(Connection.conn_id).all()}
+    assert len(response) == 1
+    assert "conn_id_with_trailing_blanks" in list(response)[0]
+

Review Comment:
   Thanks for the feedback. Pushing the changes to fix this



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

Reply via email to