Django 官方教程翻译项目测试将节约你的时间 测试不仅能发现错误,而且能预防错误 测试使你的代码更有吸引力 测试有利于团队协作 基本测试策略 第一个测试 首先得有个 Bug 写个测试来发现 Bug 运行测试 修复 Bug 更全面的测试 测试视图 针对视图的测试 Django 测试工具之 Client 改善视图代码 测试新视图 测试 DetailView 更多的测试 测试那是越多越好 进一步测试 行 Python 代码了,选择从哪里开始 写测试确实不怎么简单。如果是这种情况,那么在你下次修改代码(比如加新功能,或者修复 Bug) 之前写个测试是比较合理且有效的。 所以,我们现在就开始写吧。 幸运的是,我们的投票(polls)应用现在就有一个小 Bug 需要被修复:我们的要求是如果 Question 是在一天之内发布的,Question.was_published_recently() 方法,发现 was_published_recently() 返回了 True,而我们希 望它返回 False 测试系统通知我们哪些测试样例失败了,和造成测试失败的代码所在的行号。 运行测试 修复 Bug 创建你的第一个 Django 项目, 第五部分 - 57 - 本文档使用 书栈(BookStack.CN) 构建 我们现在知道了,问题出在当 pub_date 为将来时, Question0 码力 | 103 页 | 1.86 MB | 1 年前3
WeRoBot 1.12.0 微信公众号开发框架文档请现在 GitHub 上 Fork [https://github.com/whtsky/WeRoBot] WeRoBot 仓库, 然后在 master 分支上开一个新的 分支。 如果你的贡献的代码是修复 Bug , 请确认这个 Bug 已经有了对应的 Issue (如 果没有, 请先创建一个); 然后在 Pull Request 的描述里面引用这个 Bug 的 Issue ID , 就像这样(假设 com/offu/WeRoBot/pull/539] ) 停止了对 SAE 相关代码的测试。 ( #539 [https://github.com/offu/WeRoBot/pull/539] ) Version 1.10.1 修复 群发接口 的 docstring 样式。 Version 1.10.0 在 Client 中增加对 上传图文消息素材 的支持 ( #493 [https://github.com/offu/WeRoBot/pull/493] (#383 [https://github.com/offu/WeRoBot/issues/383]) (#412 [https://github.com/offu/WeRoBot/pull/412]) 修复 imp 在 Python3.4 后被废弃的问题 (#411 [https://github.com/offu/WeRoBot/pull/411]) Version 1.7.0 为 werobot0 码力 | 103 页 | 74.49 KB | 1 年前3
WeRoBot 1.10.1 微信公众号开发框架文档请现在 GitHub 上 Fork [https://github.com/whtsky/WeRoBot] WeRoBot 仓库, 然后在 master 分支上开一个新的 分支。 如果你的贡献的代码是修复 Bug , 请确认这个 Bug 已经有了对应的 Issue (如 果没有, 请先创建一个); 然后在 Pull Request 的描述里面引用这个 Bug 的 Issue ID , 就像这样(假设 level='info') 按照配置开启 log 的格式化优化。 logger – 配置的 logger 对象 level – 要为 logger 设置的等级 Changelog Version 1.10.1 修复 群发接口 的 docstring 样式。 Version 1.10.0 在 Client 中增加对 上传图文消息素材 的支持 ( #493 [https://github.com/offu/WeRoBot/pull/493] (#383 [https://github.com/offu/WeRoBot/issues/383]) (#412 [https://github.com/offu/WeRoBot/pull/412]) 修复 imp 在 Python3.4 后被废弃的问题 (#411 [https://github.com/offu/WeRoBot/pull/411]) Version 1.7.0 为 werobot0 码力 | 102 页 | 73.98 KB | 1 年前3
WeRoBot 1.13.1 微信公众号开发框架文档请现在 GitHub 上 Fork [https://github.com/whtsky/WeRoBot] WeRoBot 仓库, 然后在 master 分支上开一个新的 分支。 如果你的贡献的代码是修复 Bug , 请确认这个 Bug 已经有了对应的 Issue (如 果没有, 请先创建一个); 然后在 Pull Request 的描述里面引用这个 Bug 的 Issue ID , 就像这样(假设 com/offu/WeRoBot/pull/539] ) 停止了对 SAE 相关代码的测试。 ( #539 [https://github.com/offu/WeRoBot/pull/539] ) Version 1.10.1 修复 群发接口 的 docstring 样式。 Version 1.10.0 在 Client 中增加对 上传图文消息素材 的支持 ( #493 [https://github.com/offu/WeRoBot/pull/493] (#383 [https://github.com/offu/WeRoBot/issues/383]) (#412 [https://github.com/offu/WeRoBot/pull/412]) 修复 imp 在 Python3.4 后被废弃的问题 (#411 [https://github.com/offu/WeRoBot/pull/411]) Version 1.7.0 为 werobot0 码力 | 105 页 | 76.25 KB | 1 年前3
WeRoBot 1.11.0 微信公众号开发框架文档请现在 GitHub 上 Fork [https://github.com/whtsky/WeRoBot] WeRoBot 仓库, 然后在 master 分支上开一个新的 分支。 如果你的贡献的代码是修复 Bug , 请确认这个 Bug 已经有了对应的 Issue (如 果没有, 请先创建一个); 然后在 Pull Request 的描述里面引用这个 Bug 的 Issue ID , 就像这样(假设 com/offu/WeRoBot/pull/539] ) 停止了对 SAE 相关代码的测试。 ( #539 [https://github.com/offu/WeRoBot/pull/539] ) Version 1.10.1 修复 群发接口 的 docstring 样式。 Version 1.10.0 在 Client 中增加对 上传图文消息素材 的支持 ( #493 [https://github.com/offu/WeRoBot/pull/493] (#383 [https://github.com/offu/WeRoBot/issues/383]) (#412 [https://github.com/offu/WeRoBot/pull/412]) 修复 imp 在 Python3.4 后被废弃的问题 (#411 [https://github.com/offu/WeRoBot/pull/411]) Version 1.7.0 为 werobot0 码力 | 103 页 | 74.21 KB | 1 年前3
WeRoBot 1.8.0 微信公众号开发框架文档请现在 GitHub 上 Fork [https://github.com/whtsky/WeRoBot] WeRoBot 仓库, 然后在 master 分支上开一个新的 分支。 如果你的贡献的代码是修复 Bug , 请确认这个 Bug 已经有了对应的 Issue (如 果没有, 请先创建一个); 然后在 Pull Request 的描述里面引用这个 Bug 的 Issue ID , 就像这样(假设 (#383 [https://github.com/offu/WeRoBot/issues/383]) (#412 [https://github.com/offu/WeRoBot/pull/412]) 修复 imp 在 Python3.4 后被废弃的问题 (#411 [https://github.com/offu/WeRoBot/pull/411]) Version 1.7.0 为 werobot com/offu/WeRoBot/pull/305])(Author: cxgreat2014 [https://github.com/cxgreat2014]) Version 1.4.1 修复 werobot.client.Client.post() 中文文件名的 bug (#292 [https://github.com/offu/WeRoBot/issues/292]) Version0 码力 | 96 页 | 75.79 KB | 1 年前3
WeRoBot 1.9.0 微信公众号开发框架文档请现在 GitHub 上 Fork [https://github.com/whtsky/WeRoBot] WeRoBot 仓库, 然后在 master 分支上开一个新的 分支。 如果你的贡献的代码是修复 Bug , 请确认这个 Bug 已经有了对应的 Issue (如 果没有, 请先创建一个); 然后在 Pull Request 的描述里面引用这个 Bug 的 Issue ID , 就像这样(假设 (#383 [https://github.com/offu/WeRoBot/issues/383]) (#412 [https://github.com/offu/WeRoBot/pull/412]) 修复 imp 在 Python3.4 后被废弃的问题 (#411 [https://github.com/offu/WeRoBot/pull/411]) Version 1.7.0 为 werobot com/offu/WeRoBot/pull/305])(Author: cxgreat2014 [https://github.com/cxgreat2014]) Version 1.4.1 修复 werobot.client.Client.post() 中文文件名的 bug (#292 [https://github.com/offu/WeRoBot/issues/292]) Version0 码力 | 99 页 | 76.68 KB | 1 年前3
WeRoBot 1.10.0 微信公众号开发框架文档请现在 GitHub 上 Fork [https://github.com/whtsky/WeRoBot] WeRoBot 仓库, 然后在 master 分支上开一个新的 分支。 如果你的贡献的代码是修复 Bug , 请确认这个 Bug 已经有了对应的 Issue (如 果没有, 请先创建一个); 然后在 Pull Request 的描述里面引用这个 Bug 的 Issue ID , 就像这样(假设 (#383 [https://github.com/offu/WeRoBot/issues/383]) (#412 [https://github.com/offu/WeRoBot/pull/412]) 修复 imp 在 Python3.4 后被废弃的问题 (#411 [https://github.com/offu/WeRoBot/pull/411]) Version 1.7.0 为 werobot com/offu/WeRoBot/pull/305])(Author: cxgreat2014 [https://github.com/cxgreat2014]) Version 1.4.1 修复 werobot.client.Client.post() 中文文件名的 bug (#292 [https://github.com/offu/WeRoBot/issues/292]) Version0 码力 | 101 页 | 73.89 KB | 1 年前3
WeRoBot 1.10.0 微信公众号开发框架文档请现在 GitHub 上 Fork [https://github.com/whtsky/WeRoBot] WeRoBot 仓库, 然后在 master 分支上开一个新的 分支。 如果你的贡献的代码是修复 Bug , 请确认这个 Bug 已经有了对应的 Issue (如 果没有, 请先创建一个); 然后在 Pull Request 的描述里面引用这个 Bug 的 Issue ID , 就像这样(假设 (#383 [https://github.com/offu/WeRoBot/issues/383]) (#412 [https://github.com/offu/WeRoBot/pull/412]) 修复 imp 在 Python3.4 后被废弃的问题 (#411 [https://github.com/offu/WeRoBot/pull/411]) Version 1.7.0 为 werobot com/offu/WeRoBot/pull/305])(Author: cxgreat2014 [https://github.com/cxgreat2014]) Version 1.4.1 修复 werobot.client.Client.post() 中文文件名的 bug (#292 [https://github.com/offu/WeRoBot/issues/292]) Version0 码力 | 101 页 | 73.89 KB | 1 年前3
WeRoBot 1.6.0 微信公众号开发框架文档请现在 GitHub 上 Fork [https://github.com/whtsky/WeRoBot] WeRoBot 仓库, 然后在 master 分支上开一个新的 分支。 如果你的贡献的代码是修复 Bug , 请确认这个 Bug 已经有了对应的 Issue (如 果没有, 请先创建一个); 然后在 Pull Request 的描述里面引用这个 Bug 的 Issue ID , 就像这样(假设 com/offu/WeRoBot/pull/305])(Author: cxgreat2014 [https://github.com/cxgreat2014]) Version 1.4.1 修复 werobot.client.Client.post() 中文文件名的 bug (#292 [https://github.com/offu/WeRoBot/issues/292]) Version Python 3.6+ 下优先使用 secrets.choice 来随机生成 token 修复 werobot.client.Client.get_media_list() 的调用参数错误 (#208 [https://github.com/whtsky/WeRoBot/issues/208]) 修复了某些情况下 Client 中文编码不正确的问题 (#250 [https://github0 码力 | 85 页 | 89.26 KB | 1 年前3
共 48 条
- 1
- 2
- 3
- 4
- 5













