django liveservertestcase错误

时间:2013-10-03 06:51:47

标签: django-testing django-tests

我正在尝试在我的应用程序中运行django测试 我的应用程序是“帐户”,在我使用命令
运行测试后 “python manage.py测试帐户”
它创建了一个apt的测试数据库。因此,测试的默认端口是localhost:8081。但是当测试使用url“locahost:8081 / accounts / login”登录登录功能时,我看不到登录页面,而是显示空白页面。我收到错误说

NoSuchElementException: Message: u'Unable to locate element: {"method":"id","selector":"id_username"}' ; Stacktrace: Method FirefoxDriver.prototype.findElementInternal_ threw an error in file:///tmp/tmpfJYYIZ/extensions/fxdriver@googlecode.com/components/driver_component.js

所以我认为它无法加载登录页面,因此它没有找到id_username(这是登录页面中文本框的id)。

我想可能无法加载“localhost:8081”所以我将它添加到tests.py的setUpClass中的django_site数据库表中。但它仍然没有用。

我还尝试在fixtures中添加“localhost:8081”并将其包含在tests.py中。它也没有帮助。
请问任何想法。??

0 个答案:

没有答案