To avoid keeping track of ``i`` yourself, you can do:

~~~python
for i, row in enumerate(results):
    self.assertEqual(row['i'], i)
~~~