parts/django/tests/regressiontests/utils/tzinfo.py
author Nishanth Amuluru <nishanth@fossee.in>
Tue, 11 Jan 2011 12:30:10 +0530
changeset 378 8fcde6f8f750
parent 307 c6bca38c1cbf
permissions -rw-r--r--
added view_user functionality

import unittest

from django.utils.tzinfo import FixedOffset

class TzinfoTests(unittest.TestCase):

    def test_fixedoffset(self):
        self.assertEquals(repr(FixedOffset(0)), '+0000')
        self.assertEquals(repr(FixedOffset(60)), '+0100')
        self.assertEquals(repr(FixedOffset(-60)), '-0100')
        self.assertEquals(repr(FixedOffset(280)), '+0440')
        self.assertEquals(repr(FixedOffset(-280)), '-0440')
        self.assertEquals(repr(FixedOffset(-78.4)), '-0118')
        self.assertEquals(repr(FixedOffset(78.4)), '+0118')
        self.assertEquals(repr(FixedOffset(-5.5*60)), '-0530')
        self.assertEquals(repr(FixedOffset(5.5*60)), '+0530')
        self.assertEquals(repr(FixedOffset(-.5*60)), '-0030')
        self.assertEquals(repr(FixedOffset(.5*60)), '+0030')