<s> class TestAssistant ( object ) : <EOL> def assertFieldValueExist ( self , records , fields , values , times = None , <EOL> msg = None ) : <EOL> """<STR_LIT>""" <EOL> count = <NUM_LIT:0> <EOL> for entry in records : <EOL> data = [ getattr ( entry , field ) for field in fields ] <EOL> if all ( item == value for item , value in zip ( data , values ) ) : <EOL> count += <NUM_LIT:1> <EOL> if times is None : <EOL> msg = '<STR_LIT>' . format ( zip ( fields , values ) ) <EOL> self . assertGreater ( count , <NUM_LIT:0> , msg = msg ) <EOL> else : <EOL> msg = ( '<STR_LIT>' <EOL> '<STR_LIT>' . format ( zip ( fields , values ) , count , times ) ) <EOL> self . assertEqual ( count , times , msg = msg ) <EOL> def assertFieldValueNotExist ( self , records , fields , values ) : <EOL> """<STR_LIT>""" <EOL> msg = '<STR_LIT>' . format ( zip ( fields , values ) ) <EOL> self . assertFieldValueExist ( records , fields , values , times = <NUM_LIT:0> , msg = msg ) </s>
