'Test validation with custom format (overriding settings)'

def testCustomFormat(self):

    current.deployment_settings.L10n.date_format = '%d/%m/%Y'
    current.deployment_settings.L10n.time_format = '%H:%M:%S'
    validate = IS_UTC_DATETIME(format='%d.%m.%Y    %I:%M    %p')
    assertEqual = self.assertEqual
    dtstr = '19.11.2011    02:00    PM'
    (value, error) = validate(dtstr)
    assertEqual(error, None)
    assertEqual(value, datetime.datetime(2011, 11, 19, 14, 0, 0))
    dtstr = '2011-11-19    14:00:00'
    (value, error) = validate(dtstr)
    assertEqual(error, validate.error_message)
    assertEqual(value, dtstr)
