def check_field(collection, field):
 print ('Getting %s from %r' % (field.name, collection))
 assert_equals(field.default, getattr(collection, field.name))
 new_value = ('new ' + field.name)
 print ('Setting %s to %s on %r' % (field.name, new_value, collection))
 setattr(collection, field.name, new_value)
 print ('Checking %s on %r' % (field.name, collection))
 assert_equals(new_value, getattr(collection, field.name))
 print ('Deleting %s from %r' % (field.name, collection))
 delattr(collection, field.name)
 print ('Back to defaults for %s in %r' % (field.name, collection))
 assert_equals(field.default, getattr(collection, field.name))

def check_field ( collection , field ) : print ( 'Getting %s from %r' % ( field . name , collection ) ) assert_equals ( field . default , getattr ( collection , field . name ) ) new_value = ( 'new ' + field . name ) print ( 'Setting %s to %s on %r' % ( field . name , new_value , collection ) ) setattr ( collection , field . name , new_value ) print ( 'Checking %s on %r' % ( field . name , collection ) ) assert_equals ( new_value , getattr ( collection , field . name ) ) print ( 'Deleting %s from %r' % ( field . name , collection ) ) delattr ( collection , field . name ) print ( 'Back to defaults for %s in %r' % ( field . name , collection ) ) assert_equals ( field . default , getattr ( collection , field . name ) )
test method .