web_test.py 文件源码

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

项目:aweasome_learning 作者: Knight-ZXW 项目源码 文件源码
def test_non_reversible(self):
        # URLSpecs are non-reversible if they include non-constant
        # regex features outside capturing groups. Currently, this is
        # only strictly enforced for backslash-escaped character
        # classes.
        paths = [
            r'^/api/v\d+/foo/(\w+)$',
        ]
        for path in paths:
            # A URLSpec can still be created even if it cannot be reversed.
            url_spec = url(path, None)
            try:
                result = url_spec.reverse()
                self.fail("did not get expected exception when reversing %s. "
                          "result: %s" % (path, result))
            except ValueError:
                pass
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号