1
0
mirror of https://github.com/django/django.git synced 2024-12-27 19:46:22 +00:00
django/tests/regressiontests/utils/tzinfo.py
Russell Keith-Magee afd040d4d3 Updated test assertions that have been deprecated by the move to unittest2. In summary, this means:
assert_ -> assertTrue
 assertEquals -> assertEqual
 failUnless -> assertTrue

For full details, see http://www.voidspace.org.uk/python/articles/unittest2.shtml#deprecations

git-svn-id: http://code.djangoproject.com/svn/django/trunk@15728 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-03-03 15:04:39 +00:00

19 lines
784 B
Python

import unittest
from django.utils.tzinfo import FixedOffset
class TzinfoTests(unittest.TestCase):
def test_fixedoffset(self):
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')