
简介
该用户还未填写简介
擅长的技术栈
可提供的服务
暂无可提供的服务
【代码】Python自动化测试之使用pytest-mock模拟用户输入。

昨天手动测试 djangorestframework时,遇到 403 {'detail': 'Authentication credentials were not provided.'} 的问题,今天自动测试又遇到了,所以记录一下:一、手动提交时,我是这样解决问题的:http -a wenjie:jaket521 POST http://127.0.0.1:8000/snippets/
注:pip安装时如果报443连接超时,可以用ssh的方式(本地公钥需配置到github里):pip install --upgrade 'git+ssh://git@github.com/tortoise/tortoise-orm.git'解决:升级tortoise-orm使用github上的待发布版。如果还想消除warnning提示,可参照库文档的示例修改代码。升级完成后,不再报错了。

pip --version时报了No module named pip.main的错误参考了这个:No module named pip.__main__; ‘pip‘ is a package and cannot be directly executed_天天放羊的博客-CSDN博客执行了:python -m ensurepip然后再重新python -m pip install -U pip
FastDFS的版本是最新的6.12(截至2024.05.15)升级成功后,重新执行代码,发现已经不再报错,能正常上传文件了。(需要Python3.10+)方案一:升级依赖包(

FastDFS的版本是最新的6.12(截至2024.05.15)升级成功后,重新执行代码,发现已经不再报错,能正常上传文件了。(需要Python3.10+)方案一:升级依赖包(

FastAPI默认使用Python的标准库来做json解析,如果换成rust编写的orjson,速度上会快一些。2. 设置为默认响应类型。

注:pip安装时如果报443连接超时,可以用ssh的方式(本地公钥需配置到github里):pip install --upgrade 'git+ssh://git@github.com/tortoise/tortoise-orm.git'解决:升级tortoise-orm使用github上的待发布版。如果还想消除warnning提示,可参照库文档的示例修改代码。升级完成后,不再报错了。

解决ImportError: libpython3.7m.so.1.0: cannot open shared object file: No such file or directory
命令如下:poetry export --with=dev --without-hashes -o dev_requirements.txt








