#NEWLINE# def _update_check_db( self , obj , data = None , results = None ) : #NEWLINE# #INDENT# if ( data is None ) : #NEWLINE# #INDENT# data = self . __data #NEWLINE# #UNINDENT# if ( results is None ) : #NEWLINE# #INDENT# results = ( self . __results or { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } ) #NEWLINE# #UNINDENT# for ( key , value ) in six . iteritems ( data ) : #NEWLINE# #INDENT# if isinstance ( obj , dict ) : #NEWLINE# #INDENT# attribute = obj . get ( key ) #NEWLINE# if isinstance ( attribute , list ) : #NEWLINE# #INDENT# self . assertListEqual ( attribute , value ) #NEWLINE# continue #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# if hasattr ( obj , ( '%s_id' % key ) ) : #NEWLINE# #INDENT# related = getattr ( obj , key ) #NEWLINE# attribute = self . get_relationship_value ( related , key ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# attribute = getattr ( obj , key ) #NEWLINE# if isinstance ( attribute , Manager ) : #NEWLINE# #INDENT# items = { self . get_relationship_value ( item , key ) for item in attribute . all ( ) } #NEWLINE# self . assertTrue ( set ( value ) . issubset ( items ) ) #NEWLINE# continue #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# self . assertEqual ( attribute , results . get ( key , obj ) )