将favicon.ico添加到base.html django selenium StaticLiveServerTestCase时出现WinError 10054

将favicon.ico添加到base.html django selenium StaticLiveServerTestCase时出现WinError 10054,django,selenium,Django,Selenium,我正在网上学习一个教程,我已经能够准确地跟踪我的机器上发生这个错误的地方。我使用的是windows 8.1 SP1,我使用的是selenium StaticLiveServerTestCase(我知道它很慢,但在教程中使用过) 但如果我有 <link rel="shortcut icon" href="{% static 'favicon.ico' %}" type="image/x-icon"> 我将获得Winerror 10054:远程主机强制关闭了现有连接如果我删除该

我正在网上学习一个教程,我已经能够准确地跟踪我的机器上发生这个错误的地方。我使用的是windows 8.1 SP1,我使用的是selenium StaticLiveServerTestCase(我知道它很慢,但在教程中使用过)

但如果我有

 <link rel="shortcut icon" href="{% static 'favicon.ico' %}" 
 type="image/x-icon"> 
我将获得Winerror 10054:远程主机强制关闭了现有连接如果我删除该链接标签,selenium测试运行时不会出现任何问题

这似乎是一个相对良性的问题

python manage.py runserver
运行没有问题,并显示图标,但我仍然想清除它的道路上

这是我的测试代码

from selenium import webdriver
from django.core.urlresolvers import reverse
from django.contrib.staticfiles.testing import StaticLiveServerTestCase
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC

class HomeNewVisitorTest(StaticLiveServerTestCase):

def setUp(self):
    self.browser = webdriver.Firefox()
    self.browser.implicitly_wait(3)

def tearDown(self):
        self.browser.quit()

def get_full_url(self, namespace):
    return self.live_server_url + reverse(namespace)

def test_home_title(self):
    self.browser.get(self.get_full_url("home"))   
    self.assertIn("TaskBuster", self.browser.title)

def test_h1_css(self):
    self.browser.get(self.get_full_url("home"))
    h1 = self.browser.find_element_by_tag_name("h1")
    self.assertEqual(h1.value_of_css_property("color"),
                        "rgba(200, 50, 255, 1)")              
def test_home_files(self):
    self.browser.get(self.live_server_url + "/robots.txt")
    self.assertNotIn("Not Found", self.browser.title)
    self.browser.get(self.live_server_url + "/humans.txt")
    self.assertNotIn("Not Found", self.browser.title)
为了在这里提供参考,我将参考教程的特定部分

http://www.marinamele.com/taskbuster-django-tutorial/template-inheritance-website-files-and-testing-with-coverage#favicon
**编辑:我尝试了以下修复,但没有成功


**添加了完整的回溯

您可以发布完整的错误回溯吗?谢谢。添加了完整的回溯。你能发布完整的错误回溯吗?谢谢。添加了完整的回溯
http://www.marinamele.com/taskbuster-django-tutorial/template-inheritance-website-files-and-testing-with-coverage#favicon