Move integration test of custom query.

This really should be located next to the remaining template query tests as it
is an integration test of said template based query.