Ticket #12125: previous-month-11696.diff
File previous-month-11696.diff, 718 bytes (added by , 15 years ago) |
---|
-
tests/regressiontests/views/tests/generic/date_based.py
100 100 101 101 now = datetime.now() 102 102 prev_month = now.date().replace(day=1) 103 if prev_month.month == 11: 103 if prev_month.month == 1: 104 # If the current month is January, then the 105 # previous month is december 104 106 prev_month = prev_month.replace(year=prev_month.year-1, month=12) 105 107 else: 106 108 prev_month = prev_month.replace(month=prev_month.month-1)