Changeset 3186
- Timestamp:
- 06/21/06 06:11:03 (2 years ago)
- Files:
-
- django/trunk/django/utils/timesince.py (modified) (1 diff)
- django/trunk/tests/othertests/templates.py (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
django/trunk/django/utils/timesince.py
r3185 r3186 25 25 t = time.localtime() 26 26 if d.tzinfo: 27 tz = LocalTimezone( )27 tz = LocalTimezone(d) 28 28 else: 29 29 tz = None django/trunk/tests/othertests/templates.py
r3185 r3186 5 5 from django.template import loader 6 6 from django.utils.translation import activate, deactivate, install 7 from django.utils.tzinfo import LocalTimezone 7 8 from datetime import datetime, timedelta 8 9 import traceback … … 58 59 return "OtherClass.method" 59 60 60 # NOW used by timesince tag tests.61 # NOW and NOW_tz are used by timesince tag tests. 61 62 NOW = datetime.now() 63 NOW_tz = datetime.now(LocalTimezone(datetime.now())) 62 64 63 65 # SYNTAX -- … … 545 547 'timesince04' : ('{{ a|timesince:b }}', {'a':NOW + timedelta(days=2), 'b':NOW + timedelta(days=1)}, '1 day'), 546 548 'timesince05' : ('{{ a|timesince:b }}', {'a':NOW + timedelta(days=2), 'b':NOW + timedelta(days=2)}, '0 minutes'), 549 550 # Check that timezone is respected 551 'timesince06' : ('{{ a|timesince:b }}', {'a':NOW_tz + timedelta(hours=8), 'b':NOW_tz}, '8 hours'), 547 552 548 553 ### TIMEUNTIL TAG ##################################################
