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