#NEWLINE# def test_proxy_get_real_instance_class( self ) : #NEWLINE# #INDENT# '\n        The call to ``get_real_instance()`` also checks whether the returned model is of the correct type.\n        This unit test guards that this check is working properly. For instance,\n        proxy child models need to be handled separately.\n        ' #NEWLINE# name = 'Item1' #NEWLINE# nonproxychild = NonProxyChild . objects . create ( name = name ) #NEWLINE# pb = ProxyBase . objects . get ( id = 1 ) #NEWLINE# self . assertEqual ( pb . get_real_instance_class ( ) , NonProxyChild ) #NEWLINE# self . assertEqual ( pb . get_real_instance ( ) , nonproxychild ) #NEWLINE# self . assertEqual ( pb . name , name ) #NEWLINE# pbm = ProxyChild . objects . get ( id = 1 ) #NEWLINE# self . assertEqual ( pbm . get_real_instance_class ( ) , NonProxyChild ) #NEWLINE# self . assertEqual ( pbm . get_real_instance ( ) , nonproxychild ) #NEWLINE# self . assertEqual ( pbm . name , pb )