'Tests that iterating over a query set pulls back all of the expected results'

@execute_count(3)
def test_iteration(self):

    q = self.table.objects(test_id=0)
    compare_set = set([(0, 5), (1, 10), (2, 15), (3, 20)])
    for t in q:
        val = (t.attempt_id, t.expected_result)
        assert (val in compare_set)
        compare_set.remove(val)
    assert (len(compare_set) == 0)
    q = self.table.objects(attempt_id=3).allow_filtering()
    assert (len(q) == 3)
    compare_set = set([(0, 20), (1, 20), (2, 75)])
    for t in q:
        val = (t.test_id, t.expected_result)
        assert (val in compare_set)
        compare_set.remove(val)
    assert (len(compare_set) == 0)
    q = self.table.objects((self.table.column('attempt_id') == 3)).allow_filtering()
    assert (len(q) == 3)
    compare_set = set([(0, 20), (1, 20), (2, 75)])
    for t in q:
        val = (t.test_id, t.expected_result)
        assert (val in compare_set)
        compare_set.remove(val)
    assert (len(compare_set) == 0)
