test_decorators.py 文件源码

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

项目:django-validator 作者: romain-li 项目源码 文件源码
def test_file(self):
        """
        Test for file upload decorator.
        """

        @FILE('f', type='file')
        def view(request, f):
            self.assertIsInstance(f, File)

        test_file = io.StringIO()
        self.post(view, data={'f': test_file})
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号