diff options
| author | Adrian Holovaty <adrian@holovaty.com> | 2010-01-10 17:28:20 +0000 |
|---|---|---|
| committer | Adrian Holovaty <adrian@holovaty.com> | 2010-01-10 17:28:20 +0000 |
| commit | a7dc2c06532586f8988d04d8f697c4ebfcabfde8 (patch) | |
| tree | 85ad5edac6304b1af3a84a5b6edc161e8cae1f2b /tests/regressiontests | |
| parent | ddd6f28cac9839ec1f98a1b591e8f8397cf77ce4 (diff) | |
Fixed #10979 -- Fixed misleading FixedOffset.__repr__(). Thanks, gsong
git-svn-id: http://code.djangoproject.com/svn/django/trunk@12164 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests/regressiontests')
| -rw-r--r-- | tests/regressiontests/utils/tests.py | 2 | ||||
| -rw-r--r-- | tests/regressiontests/utils/tzinfo.py | 30 |
2 files changed, 32 insertions, 0 deletions
diff --git a/tests/regressiontests/utils/tests.py b/tests/regressiontests/utils/tests.py index cd93fb9c01..daae84b6d5 100644 --- a/tests/regressiontests/utils/tests.py +++ b/tests/regressiontests/utils/tests.py @@ -10,6 +10,7 @@ from django.utils.functional import SimpleLazyObject import timesince import datastructures import itercompat +import tzinfo from decorators import DecoratorFromMiddlewareTests from functional import FunctionalTestCase @@ -26,6 +27,7 @@ __test__ = { 'timesince': timesince, 'datastructures': datastructures, 'itercompat': itercompat, + 'tzinfo': tzinfo, } from dateformat import * diff --git a/tests/regressiontests/utils/tzinfo.py b/tests/regressiontests/utils/tzinfo.py new file mode 100644 index 0000000000..b62570c225 --- /dev/null +++ b/tests/regressiontests/utils/tzinfo.py @@ -0,0 +1,30 @@ +""" +>>> from django.utils.tzinfo import FixedOffset + +>>> 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 +""" + +if __name__ == "__main__": + import doctest + doctest.testmod() |
