简体   繁体   English

Django测试客户端之类的工具?

[英]Django Test Client Like Tool?

I've got to know and love the Django Test client. 我必须了解并喜欢Django Test客户端。 I'd really like to use it to test external sites and URLs outside of the current project. 我真的很想用它来测试当前项目之外的外部站点和URL。

  • Is this possible? 这可能吗?
  • If not, is there something similar I could use? 如果没有,我可以使用类似的东西吗? (ideally in Python) (理想情况是在Python中)

I don't need to do anything dramatic, just, say, grab a URL and check the status code, check that it took less than x seconds, and that it contains some text. 我不需要做任何戏剧性的事情,例如,获取URL并检查状态代码,检查所用的时间少于x秒,并且其中包含一些文本。

Ideally I'd like it so that I could run/trigger these tests from some sort of hosted web app, and also have them run at certain intervals. 理想情况下,我希望它可以使我从某种托管的Web应用程序中运行/触发这些测试,并使它们以一定的间隔运行。

I realise it wouldn't take too much to roll something myself, but I'd prefer to jump onboard something which already exists so wanted to check what the options were before I do so. 我知道自己自己滚动不需要花太多时间,但是我更愿意跳入已经存在的东西,因此想在我这样做之前先检查一下选项。

Thanks loads. 感谢负载。

Rolo. 罗洛

No, it doesn't work like that. 不,它不是那样工作的。 It's not a real web client, it's just a piece of internal Django code that catches the request and returns the relevant response. 这不是一个真正的Web客户端,它只是一段内部Django代码,可以捕获请求并返回相关的响应。

The best tool for the sort of testing you're talking about is something like Selenium . 最好的工具就是Selenium之类的东西。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM