@@ -344,16 +344,17 @@ def test_duplicate_connection(admin_client):
344
344
345
345
data = {"action" : "mulduplicate" , "rowid" : [conn1 .id , conn3 .id ]}
346
346
resp = admin_client .post ("/connection/action_post" , data = data , follow_redirects = True )
347
- expected_result = {
347
+ assert resp .status_code == 200
348
+
349
+ expected_connections_ids = {
348
350
"test_duplicate_gcp_connection" ,
349
351
"test_duplicate_gcp_connection_copy1" ,
350
352
"test_duplicate_mysql_connection" ,
351
353
"test_duplicate_postgres_connection_copy1" ,
352
354
"test_duplicate_postgres_connection_copy2" ,
353
355
}
354
- response = {conn [0 ] for conn in session .query (Connection .conn_id ).all ()}
355
- assert resp .status_code == 200
356
- assert expected_result == response
356
+ connections_ids = {conn .conn_id for conn in session .query (Connection .conn_id )}
357
+ assert expected_connections_ids == connections_ids
357
358
358
359
359
360
def test_duplicate_connection_error (admin_client ):
@@ -380,12 +381,11 @@ def test_duplicate_connection_error(admin_client):
380
381
381
382
data = {"action" : "mulduplicate" , "rowid" : [connections [0 ].id ]}
382
383
resp = admin_client .post ("/connection/action_post" , data = data , follow_redirects = True )
383
-
384
- expected_result = {f"test_duplicate_postgres_connection_copy{ i } " for i in range (1 , 11 )}
385
-
386
384
assert resp .status_code == 200
387
- response = {conn [0 ] for conn in session .query (Connection .conn_id ).all ()}
388
- assert expected_result == response
385
+
386
+ expected_connections_ids = {f"test_duplicate_postgres_connection_copy{ i } " for i in range (1 , 11 )}
387
+ connections_ids = {conn .conn_id for conn in session .query (Connection .conn_id )}
388
+ assert expected_connections_ids == connections_ids
389
389
390
390
391
391
@pytest .fixture ()
0 commit comments