Tests for Query object