'Ensure that Q objects can be queried using regexes.'

def test_q_regex(self):

    person = self.Person(name='Guido    van    Rossum')
    person.save()
    obj = self.Person.objects(Q(name=re.compile('^Gui'))).first()
    self.assertEqual(obj, person)
    obj = self.Person.objects(Q(name=re.compile('^gui'))).first()
    self.assertEqual(obj, None)
    obj = self.Person.objects(Q(name=re.compile('^gui', re.I))).first()
    self.assertEqual(obj, person)
    obj = self.Person.objects(Q(name__not=re.compile('^bob'))).first()
    self.assertEqual(obj, person)
    obj = self.Person.objects(Q(name__not=re.compile('^Gui'))).first()
    self.assertEqual(obj, None)
