'Ensure that contains, startswith, endswith, etc work.'

def test_regex_query_shortcuts(self):

    person = self.Person(name='Guido    van    Rossum')
    person.save()
    obj = self.Person.objects(name__contains='van').first()
    self.assertEqual(obj, person)
    obj = self.Person.objects(name__contains='Van').first()
    self.assertEqual(obj, None)
    obj = self.Person.objects(name__icontains='Van').first()
    self.assertEqual(obj, person)
    obj = self.Person.objects(name__startswith='Guido').first()
    self.assertEqual(obj, person)
    obj = self.Person.objects(name__startswith='guido').first()
    self.assertEqual(obj, None)
    obj = self.Person.objects(name__istartswith='guido').first()
    self.assertEqual(obj, person)
    obj = self.Person.objects(name__endswith='Rossum').first()
    self.assertEqual(obj, person)
    obj = self.Person.objects(name__endswith='rossuM').first()
    self.assertEqual(obj, None)
    obj = self.Person.objects(name__iendswith='rossuM').first()
    self.assertEqual(obj, person)
    obj = self.Person.objects(name__exact='Guido    van    Rossum').first()
    self.assertEqual(obj, person)
    obj = self.Person.objects(name__exact='Guido    van    rossum').first()
    self.assertEqual(obj, None)
    obj = self.Person.objects(name__exact='Guido    van    Rossu').first()
    self.assertEqual(obj, None)
    obj = self.Person.objects(name__iexact='gUIDO    VAN    rOSSUM').first()
    self.assertEqual(obj, person)
    obj = self.Person.objects(name__iexact='gUIDO    VAN    rOSSU').first()
    self.assertEqual(obj, None)
    person = self.Person(name="Guido    van    Rossum    [.'Geek']")
    person.save()
    obj = self.Person.objects(name__icontains="[.'Geek").first()
    self.assertEqual(obj, person)
