Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Migrated tzinfo doctests. Thanks to Stephan Jaekel.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@13887 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 60e38d29ca37d3752c4d537811af5cbf6a8ab3af 1 parent 474bd86
@freakboy3742 freakboy3742 authored
Showing with 16 additions and 28 deletions.
  1. +16 −28 tests/regressiontests/utils/tzinfo.py
View
44 tests/regressiontests/utils/tzinfo.py
@@ -1,30 +1,18 @@
-"""
->>> from django.utils.tzinfo import FixedOffset
+from django.test import TestCase
->>> FixedOffset(0)
-+0000
->>> FixedOffset(60)
-+0100
->>> FixedOffset(-60)
--0100
->>> FixedOffset(280)
-+0440
->>> FixedOffset(-280)
--0440
->>> FixedOffset(-78.4)
--0118
->>> FixedOffset(78.4)
-+0118
->>> FixedOffset(-5.5*60)
--0530
->>> FixedOffset(5.5*60)
-+0530
->>> FixedOffset(-.5*60)
--0030
->>> FixedOffset(.5*60)
-+0030
-"""
+from django.utils.tzinfo import FixedOffset
-if __name__ == "__main__":
- import doctest
- doctest.testmod()
+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')
Please sign in to comment.
Something went wrong with that request. Please try again.