为视图编写 Django 单元测试

发布于 2024-08-12 18:38:45 字数 56 浏览 4 评论 0原文

有人有编写良好视图测试的好教程/示例吗?我找到的大部分内容都是 2008 年中期的,但没什么帮助。

Does anyone have a good tute/example of writing good tests for views? Most of the stuff I've been finding was from mid 2008 which is only a little helpful.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

祁梦 2024-08-19 18:38:45

Alex Gaynor 前几天写了一些关于这个主题的提示:

开始在 Django 中进行测试

Alex Gaynor wrote some tips about this very subject just the other day:

Getting started with testing in Django

疾风者 2024-08-19 18:38:45

我不确定这是否正是您正在寻找的内容,但我一直在研究同一主题并发现此示例测试代码非常有帮助。

http://bitbucket.org/ubernostrum/django-注册/src/tip/registration/tests/views.py

I'm not sure if this is exactly what you're looking for, but I've been looking into this same topic and found this example test code very helpful.

http://bitbucket.org/ubernostrum/django-registration/src/tip/registration/tests/views.py

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文