1
0
mirror of https://github.com/django/django.git synced 2025-10-24 06:06:09 +00:00

Fixed #16924 -- Corrected date template filter handling of negative (West of UTC) timezone offsets.

The 'O' format specifier output was incorrect. Thanks mrgriscom and Aymeric Augustin.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@16903 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Ramiro Morales
2011-09-25 17:08:31 +00:00
parent 482388cd61
commit 3ef1762cb9
3 changed files with 15 additions and 5 deletions

View File

@@ -127,3 +127,9 @@ class DateFormatTests(unittest.TestCase):
self.assertEqual(dateformat.format(summertime, 'O'), u'+0200')
self.assertEqual(dateformat.format(wintertime, 'I'), u'0')
self.assertEqual(dateformat.format(wintertime, 'O'), u'+0100')
# Ticket #16924 -- We don't need timezone support to test this
# 3h30m to the west of UTC
tz = FixedOffset(-3*60 - 30)
dt = datetime(2009, 5, 16, 5, 30, 30, tzinfo=tz)
self.assertEqual(dateformat.format(dt, 'O'), u'-0330')