account_settings_tests.py 文件源码

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

项目:mltshp 作者: MLTSHP 项目源码 文件源码
def test_updating_user_profile_photo(self):
        """
        Emulate the variables that nginx passes in via the upload module
        and see if the file gets uploaded.
        """
        photo_path = os.path.abspath("static/images/test-avatar.png")
        arguments = {
            'photo_path': photo_path,
            'photo_content_type': "image/png",
            'photo_name': os.path.basename(photo_path),
            'photo_size': os.path.getsize(photo_path)
        }
        response = self.post_url('/account/settings/profile', arguments=arguments)
        user_reloaded = User.get('id = %s', self.user.id)
        self.assertTrue(user_reloaded.profile_image)
        self.assertTrue(user_reloaded.profile_image_url().find('/account') > -1)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号