@@ -447,10 +447,16 @@ def test_workspace_rest_aql(
447447 node_table = populated_table (workspace , False )
448448 nodes : Cursor = node_table .get_rows ()
449449 nodes_list = list (nodes )
450+
450451 # try and execute a valid non-mutating query on the data
451- query = f'FOR document IN { node_table .name } RETURN document'
452- r = authenticated_api_client .get (
453- f'/api/workspaces/{ workspace .name } /aql/' , data = {'query' : query }
452+ r = authenticated_api_client .post (
453+ f'/api/workspaces/{ workspace .name } /aql/' ,
454+ {
455+ 'query' : 'FOR doc IN @@TABLE RETURN doc' ,
456+ 'bind_vars' : {
457+ '@TABLE' : node_table .name ,
458+ },
459+ },
454460 )
455461 assert r .status_code == status_code
456462
@@ -466,11 +472,17 @@ def test_workspace_rest_aql_mutating_query(
466472):
467473 workspace .set_user_permission (user , WorkspaceRoleChoice .READER )
468474 fake = Faker ()
469-
470475 node_table = populated_table (workspace , False )
476+
471477 # Mutating query
472- query = f"INSERT {{ 'name': { fake .pystr ()} }} INTO { node_table .name } "
473- r = authenticated_api_client .get (
474- f'/api/workspaces/{ workspace .name } /aql/' , data = {'query' : query }
478+ r = authenticated_api_client .post (
479+ f'/api/workspaces/{ workspace .name } /aql/' ,
480+ data = {
481+ 'query' : 'INSERT {name: @DOCNAME} INTO @@TABLE' ,
482+ 'bind_vars' : {
483+ '@TABLE' : node_table .name ,
484+ 'DOCNAME' : fake .pystr (),
485+ },
486+ },
475487 )
476488 assert r .status_code == 400
0 commit comments