jjzjj

LiveServerTestCase

全部标签

Python django : How to call selenium. set_speed() 与 django LiveServerTestCase

为了运行我的功能测试,我使用LiveServerTestCase。我想调用不在webdriver中但在selenium对象中的set_speed(以及其他方法,set_speed只是一个示例)。http://selenium.googlecode.com/git/docs/api/py/selenium/selenium.selenium.html#module-selenium.selenium我的LiveServerTestCase子类fromseleniumimportwebdriverclassSeleniumLiveServerTestCase(LiveServerTestC

python - Django 的 LiveServerTestCase 总是由于地址冲突而失败......尽管地址似乎是免费的

我目前正在清理我的Django功能测试以使用LiveServerTestCase,而不是从后台运行的开发环境实例中弹回基于selenium的测试,但我遇到了困难。每次我尝试运行LiveServerTestCase测试时,我都会收到以下错误:======================================================================ERROR:setUpClass(fun_tests.tests.backend.TestCmsLogin)----------------------------------------------------

python - Django 的 LiveServerTestCase 总是由于地址冲突而失败......尽管地址似乎是免费的

我目前正在清理我的Django功能测试以使用LiveServerTestCase,而不是从后台运行的开发环境实例中弹回基于selenium的测试,但我遇到了困难。每次我尝试运行LiveServerTestCase测试时,我都会收到以下错误:======================================================================ERROR:setUpClass(fun_tests.tests.backend.TestCmsLogin)----------------------------------------------------

python - LiveServerTestCase 在 django View 中的 python-requests post 调用时挂起

我正在编写一个使用我创建的RESTapi的Django应用程序。目的是使用网络应用程序证明api用例。在我看来,我因此使用python-requests库调用api,如下所示:defmy_view_method(request):ifrequest.method=='POST':form=MyForm(request.POST)ifform.is_valid():data=form.cleaned_datadata_to_post={'fieldA':data.get('fieldA_in_form'),'fieldB':data.get('fieldB_in_form'),}post

python - Django:为什么我在运行 LiveServerTestCase 测试时无法获得回溯(以防出错)?

我正在用Selenium编写一些测试。当我运行我的selenium测试(LiveServerTestCase类型)并且我的代码有一些错误(不是在测试中,我的意思是在执行的代码中,就像我用selenium到达的主页View)即使我有:DEBUG=TrueINTERNAL_IPS=('127.0.0.1',)我一直坚持这一点,我不明白为什么我的测试失败了(因为在public500中我没有显示异常)。为什么会这样?我在哪里可以解决问题?当我运行runserver时,它运行良好(我得到了回溯)。 最佳答案 来自django文档https:/