Ticket #9065: 9065-tests.diff
File 9065-tests.diff, 1.6 KB (added by , 16 years ago) |
---|
-
tests/regressiontests/templates/filters.py
7 7 consistent. 8 8 """ 9 9 10 from datetime import datetime, timedelta 10 from datetime import datetime, timedelta, date 11 11 12 12 from django.utils.tzinfo import LocalTimezone, FixedOffset 13 13 from django.utils.safestring import mark_safe … … 28 28 now = datetime.now() 29 29 now_tz = datetime.now(LocalTimezone(now)) 30 30 now_tz_i = datetime.now(FixedOffset((3 * 60) + 15)) # imaginary time zone 31 today = date.today() 31 32 return { 32 33 # Default compare with datetime.now() 33 34 'filter-timesince01' : ('{{ a|timesince }}', {'a': datetime.now() + timedelta(minutes=-1, seconds = -10)}, '1 minute'), … … 55 56 'filter-timesince15' : ('{{ a|timesince:b }}', {'a': now, 'b': now_tz_i}, ''), 56 57 'filter-timesince16' : ('{{ a|timesince:b }}', {'a': now_tz_i, 'b': now}, ''), 57 58 59 # Regression for #9065 60 'filter-timesince17' : ('{{ a|timesince:b }}', {'a': today, 'b': today}, '0 minutes'), 61 'filter-timesince18' : ('{{ a|timesince:b }}', {'a': today, 'b': today + timedelta(hours=24)}, '1 day'), 62 58 63 # Default compare with datetime.now() 59 64 'filter-timeuntil01' : ('{{ a|timeuntil }}', {'a':datetime.now() + timedelta(minutes=2, seconds = 10)}, '2 minutes'), 60 65 'filter-timeuntil02' : ('{{ a|timeuntil }}', {'a':(datetime.now() + timedelta(days=1, seconds = 10))}, '1 day'),