summaryrefslogtreecommitdiff
path: root/tests/othertests/dateformat.py
diff options
context:
space:
mode:
authorAdrian Holovaty <adrian@holovaty.com>2006-05-02 01:31:56 +0000
committerAdrian Holovaty <adrian@holovaty.com>2006-05-02 01:31:56 +0000
commitf69cf70ed813a8cd7e1f963a14ae39103e8d5265 (patch)
treed3b32e84cd66573b3833ddf662af020f8ef2f7a8 /tests/othertests/dateformat.py
parentd5dbeaa9be359a4c794885c2e9f1b5a7e5e51fb8 (diff)
MERGED MAGIC-REMOVAL BRANCH TO TRUNK. This change is highly backwards-incompatible. Please read http://code.djangoproject.com/wiki/RemovingTheMagic for upgrade instructions.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@2809 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests/othertests/dateformat.py')
-rw-r--r--tests/othertests/dateformat.py25
1 files changed, 15 insertions, 10 deletions
diff --git a/tests/othertests/dateformat.py b/tests/othertests/dateformat.py
index 3350a1f8ab..0287587b4a 100644
--- a/tests/othertests/dateformat.py
+++ b/tests/othertests/dateformat.py
@@ -1,14 +1,16 @@
-"""
+r"""
>>> format(my_birthday, '')
''
>>> format(my_birthday, 'a')
'p.m.'
>>> format(my_birthday, 'A')
'PM'
+>>> format(my_birthday, 'd')
+'08'
>>> format(my_birthday, 'j')
-'7'
+'8'
>>> format(my_birthday, 'l')
-'Saturday'
+'Sunday'
>>> format(my_birthday, 'L')
'False'
>>> format(my_birthday, 'm')
@@ -24,7 +26,7 @@
>>> format(my_birthday, 'P')
'10 p.m.'
>>> format(my_birthday, 'r')
-'Sat, 7 Jul 1979 22:00:00 +0100'
+'Sun, 8 Jul 1979 22:00:00 +0100'
>>> format(my_birthday, 's')
'00'
>>> format(my_birthday, 'S')
@@ -34,9 +36,9 @@
>>> format(my_birthday, 'T')
'CET'
>>> format(my_birthday, 'U')
-'300445200'
+'300531600'
>>> format(my_birthday, 'w')
-'6'
+'0'
>>> format(my_birthday, 'W')
'27'
>>> format(my_birthday, 'y')
@@ -44,7 +46,7 @@
>>> format(my_birthday, 'Y')
'1979'
>>> format(my_birthday, 'z')
-'188'
+'189'
>>> format(my_birthday, 'Z')
'3600'
@@ -57,8 +59,11 @@
>>> format(wintertime, 'O')
'+0100'
->>> format(my_birthday, 'Y z \\C\\E\\T')
-'1979 188 CET'
+>>> format(my_birthday, r'Y z \C\E\T')
+'1979 189 CET'
+
+>>> format(my_birthday, r'jS o\f F')
+'8th of July'
"""
from django.utils import dateformat, translation
@@ -70,6 +75,6 @@ translation.activate('en-us')
time.tzset()
-my_birthday = datetime.datetime(1979, 7, 7, 22, 00)
+my_birthday = datetime.datetime(1979, 7, 8, 22, 00)
summertime = datetime.datetime(2005, 10, 30, 1, 00)
wintertime = datetime.datetime(2005, 10, 30, 4, 00)