[1.7.x] Fixed a queries test on Python 2 broken after importing six.moves.range().
[1.7.x] Fixed a queries test on Python 2 broken after importing six.moves.range().

Backport of 837fc2d8cdfefce375697d95e241836c7be12696 from master

jyotsna1820/django,jyotsna1820/django,oscaro/django,jyotsna1820/django,oscaro/django,jyotsna1820/django,oscaro/django,oscaro/django