'Test construction of string field'

def testStringFieldConstruction(self):

    assertEqual = self.assertEqual
    assertTrue = self.assertTrue
    assertFalse = self.assertFalse
    dm = S3DynamicModel(self.TABLENAME)
    define_field = dm._field
    params = Storage(name='name', field_type='string')
    field = define_field(self.TABLENAME, params)
    assertEqual(field.name, 'name')
    assertEqual(field.type, 'string')
    assertFalse(field.requires)
    params = Storage(name='name', field_type='string', require_not_empty=True)
    field = define_field(self.TABLENAME, params)
    assertEqual(field.name, 'name')
    assertEqual(field.type, 'string')
    assertTrue(isinstance(field.requires, IS_NOT_EMPTY))
    params = Storage(name='name', field_type='string', require_unique=True, require_not_empty=True)
    field = define_field(self.TABLENAME, params)
    assertEqual(field.name, 'name')
    assertEqual(field.type, 'string')
    assertTrue(isinstance(field.requires, IS_NOT_ONE_OF))
    params = Storage(name='name', field_type='string', require_unique=True, require_not_empty=False)
    field = define_field(self.TABLENAME, params)
    assertEqual(field.name, 'name')
    assertEqual(field.type, 'string')
    assertEqual(field.default, None)
    requires = field.requires
    assertTrue(isinstance(requires, IS_EMPTY_OR))
    requires = requires.other
    assertTrue(isinstance(requires, IS_NOT_ONE_OF))
    params = Storage(name='name', field_type='string', default_value='Default    Name')
    field = define_field(self.TABLENAME, params)
    assertEqual(field.name, 'name')
    assertEqual(field.type, 'string')
    assertEqual(field.default, 'Default    Name')
