'Ensure that switching databases for a queryset is possible'

def test_using(self):

    class Number2(Document, ):
        n = IntField()
    Number2.drop_collection()
    with switch_db(Number2, 'test2') as Number2:
        Number2.drop_collection()
    for i in range(1, 10):
        t = Number2(n=i)
        t.switch_db('test2')
        t.save()
    self.assertEqual(len(Number2.objects.using('test2')), 9)
