2010-09-28 10:18:12 +02:00
|
|
|
import unittest
|
2010-01-10 18:28:20 +01:00
|
|
|
|
2010-09-27 17:14:06 +02:00
|
|
|
from django.utils.tzinfo import FixedOffset
|
2010-01-10 18:28:20 +01:00
|
|
|
|
2010-09-28 10:18:12 +02:00
|
|
|
class TzinfoTests(unittest.TestCase):
|
2010-09-27 17:14:06 +02:00
|
|
|
|
|
|
|
def test_fixedoffset(self):
|
2011-03-03 16:04:39 +01:00
|
|
|
self.assertEqual(repr(FixedOffset(0)), '+0000')
|
|
|
|
self.assertEqual(repr(FixedOffset(60)), '+0100')
|
|
|
|
self.assertEqual(repr(FixedOffset(-60)), '-0100')
|
|
|
|
self.assertEqual(repr(FixedOffset(280)), '+0440')
|
|
|
|
self.assertEqual(repr(FixedOffset(-280)), '-0440')
|
|
|
|
self.assertEqual(repr(FixedOffset(-78.4)), '-0118')
|
|
|
|
self.assertEqual(repr(FixedOffset(78.4)), '+0118')
|
|
|
|
self.assertEqual(repr(FixedOffset(-5.5*60)), '-0530')
|
|
|
|
self.assertEqual(repr(FixedOffset(5.5*60)), '+0530')
|
|
|
|
self.assertEqual(repr(FixedOffset(-.5*60)), '-0030')
|
|
|
|
self.assertEqual(repr(FixedOffset(.5*60)), '+0030')
|