#NEWLINE# def test_proxy_model_inheritance( self ) : #NEWLINE# #INDENT# '\n        Polymorphic abilities should also work when the base model is a proxy object.\n        ' #NEWLINE# self . assertEqual ( ProxiedBase . objects . model , ProxiedBase ) #NEWLINE# self . assertEqual ( ProxyModelBase . objects . model , ProxyModelBase ) #NEWLINE# self . assertEqual ( ProxyModelA . objects . model , ProxyModelA ) #NEWLINE# self . assertEqual ( ProxyModelB . objects . model , ProxyModelB ) #NEWLINE# ProxyModelA . objects . create ( name = 'object1' ) #NEWLINE# ProxyModelB . objects . create ( name = 'object2' , field2 = 'bb' ) #NEWLINE# object1 = ProxyModelBase . objects . get ( name = 'object1' ) #NEWLINE# object2 = ProxyModelBase . objects . get ( name = 'object2' ) #NEWLINE# self . assertEqual ( repr ( object1 ) , '<ProxyModelA: id 1, name (CharField) "object1", field1 (CharField) "">' ) #NEWLINE# self . assertEqual ( repr ( object2 ) , '<ProxyModelB: id 2, name (CharField) "object2", field2 (CharField) "bb">' ) #NEWLINE# self . assertIsInstance ( object1 , ProxyModelA ) #NEWLINE# self . assertIsInstance ( object2 , ProxyModelB ) #NEWLINE# objects = list ( ProxyModelBase . objects . all ( ) . order_by ( 'name' ) ) #NEWLINE# self . assertEqual ( repr ( objects [ 0 ] ) , '<ProxyModelA: id 1, name (CharField) "object1", field1 (CharField) "">' ) #NEWLINE# self . assertEqual ( repr ( objects [ 1 ] ) , '<ProxyModelB: id 2, name (CharField) "object2", field2 (CharField) "bb">' ) #NEWLINE# self . assertIsInstance ( objects [ 0 ] , ProxyModelA ) #NEWLINE# self . assertIsInstance ( objects [ 1 ] , ProxyModelB )