2010-09-27 23:14:06 +08:00
|
|
|
from django.test import TestCase
|
2010-01-11 01:28:20 +08:00
|
|
|
|
2010-09-27 23:14:06 +08:00
|
|
|
from django.utils.tzinfo import FixedOffset
|
2010-01-11 01:28:20 +08:00
|
|
|
|
2010-09-27 23:14:06 +08:00
|
|
|
class TzinfoTests(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')
|