Changeset 8192 for main/waeup.kofa/trunk/src/waeup/kofa/utils
- Timestamp:
- 17 Apr 2012, 11:19:55 (13 years ago)
- Location:
- main/waeup.kofa/trunk/src/waeup/kofa/utils
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/utils/helpers.py
r8185 r8192 569 569 570 570 If no `tz` is given, shift to UTC is performed. 571 """ 571 572 If `dt` is not a datetime.datetime, the input value is returned 573 unchanged. 574 """ 575 if not isinstance(dt, datetime.datetime): 576 return dt 572 577 if tz is None: 573 578 tz = pytz.utc -
main/waeup.kofa/trunk/src/waeup/kofa/utils/tests/test_helpers.py
r8185 r8192 304 304 return 305 305 306 def test_to_timezone_no_dt(self): 307 # the to_timezone function copes with dates (!= datetimes) 308 d = datetime.date(2012, 12, 1) 309 result1 = helpers.to_timezone(d) 310 result2 = helpers.to_timezone(d, pytz.utc) 311 self.assertEqual(result1, d) 312 self.assertEqual(result2, d) 313 return 306 314 307 315 def test_suite():
Note: See TracChangeset for help on using the changeset viewer.