'Test validation with date'

def testValidationWithDate(self):

    validate = IS_UTC_DATETIME()
    class EAST5(datetime.tzinfo, ):
        def utcoffset(self, dt):
            return datetime.timedelta(hours=5)
    assertEqual = self.assertEqual
    dt = datetime.date(2011, 11, 19)
    (value, error) = validate(dt)
    assertEqual(error, None)
    assertEqual(value, datetime.datetime(2011, 11, 19, 8, 0, 0))
    current.session.s3.utc_offset = (-8)
    dt = datetime.date(2011, 11, 19)
    (value, error) = validate(dt)
    assertEqual(error, None)
    assertEqual(value, datetime.datetime(2011, 11, 19, 16, 0, 0))
    current.session.s3.utc_offset = (+ 11)
    dt = datetime.date(2011, 11, 19)
    (value, error) = validate(dt)
    assertEqual(error, None)
    assertEqual(value, datetime.datetime(2011, 11, 18, 21, 0, 0))
