def test_pass_naive_timestamp_default_timezone(self):
"""
The incoming value is a naive timestamp, but the Filter is
configured not to treat naive timestamps as UTC.
"""
self.assertFilterPasses(
# The incoming value is a naive timestamp, and the Filter
# is configured to use UTC+8 by default.
self._filter(
'2015-05-12 09:20:03',
timezone = tzoffset('UTC+8', 8*3600),
),
# The resulting datetime is still converted to UTC.
datetime(2015, 5, 12, 1, 20, 3, tzinfo=utc),
)
评论列表
文章目录