'Test formatter'

def testFormatter(self):

    validate = IS_UTC_DATETIME()
    assertEqual = self.assertEqual
    dt = None
    dtstr = validate.formatter(dt)
    assertEqual(dtstr, current.messages['NONE'])
    dt = datetime.datetime(2011, 11, 19, 14, 0, 0)
    dtstr = validate.formatter(dt)
    assertEqual(dtstr, '2011-11-19    14:00:00')
    current.session.s3.utc_offset = (-8)
    dt = datetime.datetime(2011, 11, 19, 14, 0, 0)
    dtstr = validate.formatter(dt)
    assertEqual(dtstr, '2011-11-19    06:00:00')
    validate = IS_UTC_DATETIME(utc_offset='+0200', format='%d.%m.%Y    %I:%M    %p')
    dt = datetime.datetime(2011, 11, 19, 14, 0, 0)
    dtstr = validate.formatter(dt)
    assertEqual(dtstr, '19.11.2011    04:00    PM')
