Ticket #2099: dateformat_win32.patch

File dateformat_win32.patch, 1.8 KB (added by SmileyChris, 9 years ago)

fix so windows users can still run test suite

  • tests/regressiontests/dateformat/tests.py

     
    2121'7'
    2222>>> format(my_birthday, 'N')
    2323'July'
    24 >>> format(my_birthday, 'O')
    25 '+0100'
     24>>> format(my_birthday, 'O') == '+0100' or no_tz
     25True
    2626>>> format(my_birthday, 'P')
    2727'10 p.m.'
    28 >>> format(my_birthday, 'r')
    29 'Sun, 8 Jul 1979 22:00:00 +0100'
     28>>> format(my_birthday, 'r') == 'Sun, 8 Jul 1979 22:00:00 +0100' or no_tz
     29True
    3030>>> format(my_birthday, 's')
    3131'00'
    3232>>> format(my_birthday, 'S')
    3333'th'
    3434>>> format(my_birthday, 't')
    3535'31'
    36 >>> format(my_birthday, 'T')
    37 'CET'
    38 >>> format(my_birthday, 'U')
    39 '300531600'
     36>>> format(my_birthday, 'T') == 'CET' or no_tz
     37True
     38>>> format(my_birthday, 'U') == '300531600' or no_tz
     39True
    4040>>> format(my_birthday, 'w')
    4141'0'
    4242>>> format(my_birthday, 'W')
     
    4747'1979'
    4848>>> format(my_birthday, 'z')
    4949'189'
    50 >>> format(my_birthday, 'Z')
    51 '3600'
     50>>> format(my_birthday, 'Z') == '3600' or no_tz
     51True
    5252
    53 >>> format(summertime, 'I')
    54 '1'
    55 >>> format(summertime, 'O')
    56 '+0200'
    57 >>> format(wintertime, 'I')
    58 '0'
    59 >>> format(wintertime, 'O')
    60 '+0100'
     53>>> format(summertime, 'I') == '1' or no_tz
     54True
     55>>> format(summertime, 'O') == '+0200' or no_tz
     56True
     57>>> format(wintertime, 'I') == '0' or no_tz
     58True
     59>>> format(wintertime, 'O') == '+0100' or no_tz
     60True
    6161
    6262>>> format(my_birthday, r'Y z \C\E\T')
    6363'1979 189 CET'
     
    7373os.environ['TZ'] = 'Europe/Copenhagen'
    7474translation.activate('en-us')
    7575
    76 time.tzset()
     76no_tz = False
     77try:
     78    time.tzset()
     79except AttributeError:
     80    no_tz = True
    7781
    7882my_birthday = datetime.datetime(1979, 7, 8, 22, 00)
    7983summertime = datetime.datetime(2005, 10, 30, 1, 00)
Back to Top