'Ensure that empty Q objects won\'t hurt.'

def test_empty_q(self):

    q1 = Q()
    q2 = Q(age__gte=18)
    q3 = Q()
    q4 = Q(name='test')
    q5 = Q()
    class Person(Document, ):
        name = StringField()
        age = IntField()
    query = {'$or': [{'age': {'$gte': 18}}, {'name': 'test'}]}
    self.assertEqual(((((q1 | q2) | q3) | q4) | q5).to_query(Person), query)
    query = {'age': {'$gte': 18}, 'name': 'test'}
    self.assertEqual(((((q1 & q2) & q3) & q4) & q5).to_query(Person), query)
