PageRenderTime 263ms CodeModel.GetById 141ms app.highlight 3ms RepoModel.GetById 118ms app.codeStats 0ms

/tests/regressiontests/utils/tzinfo.py

https://code.google.com/p/mango-py/
Python | 18 lines | 15 code | 3 blank | 0 comment | 0 complexity | e880b32fa44b7a2bc048c75aa28e6071 MD5 | raw file
 1import unittest
 2
 3from django.utils.tzinfo import FixedOffset
 4
 5class TzinfoTests(unittest.TestCase):
 6
 7    def test_fixedoffset(self):
 8        self.assertEqual(repr(FixedOffset(0)), '+0000')
 9        self.assertEqual(repr(FixedOffset(60)), '+0100')
10        self.assertEqual(repr(FixedOffset(-60)), '-0100')
11        self.assertEqual(repr(FixedOffset(280)), '+0440')
12        self.assertEqual(repr(FixedOffset(-280)), '-0440')
13        self.assertEqual(repr(FixedOffset(-78.4)), '-0118')
14        self.assertEqual(repr(FixedOffset(78.4)), '+0118')
15        self.assertEqual(repr(FixedOffset(-5.5*60)), '-0530')
16        self.assertEqual(repr(FixedOffset(5.5*60)), '+0530')
17        self.assertEqual(repr(FixedOffset(-.5*60)), '-0030')
18        self.assertEqual(repr(FixedOffset(.5*60)), '+0030')