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


##########
tests/www/views/test_views_connection.py:
##########
@@ -59,14 +59,25 @@ def test_create_connection(admin_client, session):
 
 
 def test_invalid_connection_id_trailing_blanks(admin_client, session):

Review Comment:
   Good catch. Made changes



##########
tests/www/views/test_views_connection.py:
##########
@@ -59,14 +59,25 @@ def test_create_connection(admin_client, session):
 
 
 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,
-    )
+    conn_id_with_blanks = "conn_id_with_trailing_blanks   "
+    conn = {**CONNECTION, "conn_id": conn_id_with_blanks}
+    resp = admin_client.post("/connection/add", data=conn, 
follow_redirects=True)
+    check_content_in_response("Added Row", resp)
+
+    response = {conn[0] for conn in session.query(Connection.conn_id).all()}
+    assert len(response) == 1
+    assert "conn_id_with_trailing_blanks" == list(response)[0]
+
+
+def test_invalid_connection_id_leading_blanks(admin_client, session):

Review Comment:
   Made the changes



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