Add a test for query_result_to_dict