'Ensure that batch_size works.'

def test_batch_size(self):

    class A(Document, ):
        s = StringField()
    A.drop_collection()
    for i in range(100):
        A.objects.create(s=str(i))
    cnt = 0
    for a in A.objects.batch_size(10):
        cnt += 1
    self.assertEqual(cnt, 100)
    qs = A.objects.all()
    qs = qs.limit(10).batch_size(20).skip(91)
    cnt = 0
    for a in qs:
        cnt += 1
    self.assertEqual(cnt, 9)
    qs = A.objects.batch_size((-1))
    with self.assertRaises(ValueError):
        list(qs)
