simple_test.py 文件源码

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

项目:filters 作者: eflglobal 项目源码 文件源码
def test_return_naive_datetime(self):
        """
        You can configure the filter to return a naive datetime object
        (e.g., for storing in a database).

        Note that the datetime is still converted to UTC before its
        tzinfo is removed.
        """
        self.assertFilterPasses(
            self._filter(
                datetime(
                    2015, 7, 1, 9, 22, 10,
                    tzinfo=tzoffset('UTC-5', -5*3600),
                ),

                # Note that we pass `naive=True` to the Filter's
                # initializer.
                naive = True,
            ),

            # The resulting datetime is converted to UTC before its
            # timezone info is stripped.
            datetime(2015, 7, 1, 14, 22, 10, tzinfo=None),
        )
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号