timezone.py 文件源码

python
阅读 18 收藏 0 点赞 0 评论 0

项目:zing 作者: evernote 项目源码 文件源码
def test_make_aware_default_tz(settings):
    """Tests datetimes are made aware of the configured timezone."""
    settings.USE_TZ = True

    datetime_object = datetime(2016, 1, 2, 21, 52, 25)
    assert timezone.is_naive(datetime_object)
    datetime_aware = make_aware(datetime_object)
    assert timezone.is_aware(datetime_aware)

    # Not comparing `tzinfo` directly because that depends on the combination of
    # actual date+times
    assert datetime_aware.tzinfo.zone == timezone.get_default_timezone().zone
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号