test_edit_user_profile.py 文件源码

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

项目:iguana 作者: iguana-project 项目源码 文件源码
def test_upload_avatar_inTemp(self):
        avatar = open(image_path, "rb")
        new_dict = default_dict2.copy()
        new_dict['avatar'] = avatar
        avatar2 = UploadedFile(avatar, name=avatar.name, content_type="image/png", size=os.path.getsize(image_path))
        response = self.client.post(reverse('user_profile:edit_profile', kwargs={"username": user_name}),
                                    new_dict, follow=True)
        self.assertContains(response, avatar2)
        self.delete_image_test()
        avatar.close()

    # helper function
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号