'Parsing-Representation consistency test'

def testParseRepresent(self):

    assertEqual = self.assertEqual
    validate = IS_UTC_DATE()
    represent = S3DateTime.date_represent
    current.session.s3.utc_offset = (-10)
    dtstr = '1998-03-21'
    (value, error) = validate(dtstr)
    assertEqual(error, None)
    representation = validate.formatter(value)
    assertEqual(representation, dtstr)
    representation = represent(value, utc=True)
    assertEqual(representation, dtstr)
    current.session.s3.utc_offset = 0
    dtstr = '1998-03-21'
    (value, error) = validate(dtstr)
    assertEqual(error, None)
    representation = validate.formatter(value)
    assertEqual(representation, dtstr)
    representation = represent(value, utc=True)
    assertEqual(representation, dtstr)
    current.session.s3.utc_offset = 6
    dtstr = '1998-03-21'
    (value, error) = validate(dtstr)
    assertEqual(error, None)
    representation = validate.formatter(value)
    assertEqual(representation, dtstr)
    representation = represent(value, utc=True)
    assertEqual(representation, dtstr)
    current.session.s3.utc_offset = 11
    dtstr = '1998-03-21'
    (value, error) = validate(dtstr)
    assertEqual(error, None)
    representation = validate.formatter(value)
    assertEqual(representation, dtstr)
    representation = represent(value, utc=True)
    assertEqual(representation, dtstr)
