'Test construction of double field'

def testDoubleFieldConstruction(self):

    assertEqual = self.assertEqual
    assertTrue = self.assertTrue
    assertFalse = self.assertFalse
    dm = S3DynamicModel(self.TABLENAME)
    define_field = dm._field
    params = Storage(name='number', field_type='double')
    field = define_field(self.TABLENAME, params)
    assertEqual(field.name, 'number')
    assertEqual(field.type, 'double')
    requires = field.requires
    assertTrue(isinstance(requires, IS_EMPTY_OR))
    requires = requires.other
    assertTrue(isinstance(requires, IS_FLOAT_IN_RANGE))
    params = Storage(name='number', field_type='double', require_not_empty=True)
    field = define_field(self.TABLENAME, params)
    assertEqual(field.name, 'number')
    assertEqual(field.type, 'double')
    requires = field.requires
    assertTrue(isinstance(requires, IS_FLOAT_IN_RANGE))
    assertEqual(requires.minimum, None)
    assertEqual(requires.maximum, None)
    params = Storage(name='number', field_type='double', settings={'min': 2.7, 'max': 8.3})
    field = define_field(self.TABLENAME, params)
    assertEqual(field.name, 'number')
    assertEqual(field.type, 'double')
    requires = field.requires
    assertTrue(isinstance(requires, IS_EMPTY_OR))
    requires = requires.other
    assertTrue(isinstance(requires, IS_FLOAT_IN_RANGE))
    assertEqual(requires.minimum, 2.7)
    assertEqual(requires.maximum, 8.3)
