Fix test_query for python3.

Python's hash is not guaranteed to result in the same value in different
runs because of the salt added to them.
Merge pull request #433 from pooya/shayan/python3

Fix test_query for python3.