'Test construction of boolean field'

def testBooleanFieldConstruction(self):

    assertEqual = self.assertEqual
    assertTrue = self.assertTrue
    assertFalse = self.assertFalse
    dm = S3DynamicModel(self.TABLENAME)
    define_field = dm._field
    from s3 import s3_yes_no_represent
    params = Storage(name='flag', field_type='boolean')
    field = define_field(self.TABLENAME, params)
    assertEqual(field.name, 'flag')
    assertEqual(field.type, 'boolean')
    assertFalse(field.requires)
    assertEqual(field.default, False)
    assertEqual(field.represent, s3_yes_no_represent)
    params = Storage(name='flag', field_type='boolean', default_value='true')
    field = define_field(self.TABLENAME, params)
    assertEqual(field.name, 'flag')
    assertEqual(field.type, 'boolean')
    assertFalse(field.requires)
    assertEqual(field.default, True)
    assertEqual(field.represent, s3_yes_no_represent)
