Update assertions of tests of query api.

This was left behind after I've changed the query api to allow sorting only
on a single field of the query.
Merge branch 'master' into release-0.28.x