'Proxy models are included in the ancestors for a model\'s DoesNotExist
and MultipleObjectsReturned'

def test_proxy_included_in_ancestors(self):

    Person.objects.create(name='Foo    McBar')
    MyPerson.objects.create(name='Bazza    del    Frob')
    LowerStatusPerson.objects.create(status='low', name='homer')
    max_id = Person.objects.aggregate(max_id=models.Max('id'))['max_id']
    self.assertRaises(Person.DoesNotExist, MyPersonProxy.objects.get, name='Zathras')
    self.assertRaises(Person.MultipleObjectsReturned, MyPersonProxy.objects.get, id__lt=(max_id + 1))
    self.assertRaises(Person.DoesNotExist, StatusPerson.objects.get, name='Zathras')
    sp1 = StatusPerson.objects.create(name='Bazza    Jr.')
    sp2 = StatusPerson.objects.create(name='Foo    Jr.')
    max_id = Person.objects.aggregate(max_id=models.Max('id'))['max_id']
    self.assertRaises(Person.MultipleObjectsReturned, StatusPerson.objects.get, id__lt=(max_id + 1))
