#NEWLINE# def test_proxy_included_in_ancestors( self ) : #NEWLINE# #INDENT# "\n        Proxy models are included in the ancestors for a model's DoesNotExist\n        and MultipleObjectsReturned\n        " #NEWLINE# Person . objects . create ( name = 'Foo McBar' ) #NEWLINE# MyPerson . objects . create ( name = 'Bazza del Frob' ) #NEWLINE# LowerStatusPerson . objects . create ( status = 'low' , name = 'homer' ) #NEWLINE# max_id = Person . objects . aggregate ( max_id = models . Max ( 'id' ) ) [ 'max_id' ] #NEWLINE# self . assertRaises ( Person . DoesNotExist , MyPersonProxy . objects . get , name = 'Zathras' ) #NEWLINE# self . assertRaises ( Person . MultipleObjectsReturned , MyPersonProxy . objects . get , id__lt = ( max_id + 1 ) ) #NEWLINE# self . assertRaises ( Person . DoesNotExist , StatusPerson . objects . get , name = 'Zathras' ) #NEWLINE# sp1 = StatusPerson . objects . create ( name = 'Bazza Jr.' ) #NEWLINE# sp2 = StatusPerson . objects . create ( name = 'Foo Jr.' ) #NEWLINE# max_id = Person . objects . aggregate ( max_id = models . Max ( 'id' ) ) [ 'max_id' ] #NEWLINE# self . assertRaises ( Person . MultipleObjectsReturned , StatusPerson . objects . get , id__lt = ( max_id + 1 ) )