Test query before order