Ticket #12125: previous-month-11696.diff

File previous-month-11696.diff, 718 bytes (added by brutasse, 6 years ago)

Patch against trunk, rev11696

  • tests/regressiontests/views/tests/generic/date_based.py

     
    100100
    101101        now = datetime.now()
    102102        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
    104106            prev_month = prev_month.replace(year=prev_month.year-1, month=12)
    105107        else:
    106108            prev_month = prev_month.replace(month=prev_month.month-1)
Back to Top