【发布时间】:2015-01-24 03:04:47
【问题描述】:
我想对我的 django 应用程序进行一些功能测试。我正在使用硒,测试有效,但问题出在静态文件上。未找到 css/js 状态。 我的测试在 localhost:8081 上运行。 示例 bootstrap.css:
<h1>Not Found</h1><p>The requested URL /static/frontend/bootstrap/3.3.0/css/bootstrap.css was not found on this server.</p>
我找不到任何信息,我是否为 selenium 应用程序添加了一些额外的配置?
引用:
Traceback (most recent call last):
File "/usr/lib/python2.7/wsgiref/handlers.py", line 85, in run
self.result = application(self.environ, self.start_response)
File "/home/t/py/django/bid/src/venv/local/lib/python2.7/site-packages/django/test/testcases.py", line 1028, in __call__
return super(FSFilesHandler, self).__call__(environ, start_response)
File "/home/t/py/django/bid/src/venv/local/lib/python2.7/site-packages/django/core/handlers/wsgi.py", line 187, in __call__
response = self.get_response(request)
File "/home/t/py/django/bid/src/venv/local/lib/python2.7/site-packages/django/test/testcases.py", line 1011, in get_response
return self.serve(request)
File "/home/t/py/django/bid/src/venv/local/lib/python2.7/site-packages/django/test/testcases.py", line 1023, in serve
return serve(request, final_rel_path, document_root=self.get_base_dir())
File "/home/t/py/django/bid/src/venv/local/lib/python2.7/site-packages/django/views/static.py", line 50, in serve
fullpath = os.path.join(document_root, newpath)
File "/home/t/py/django/bid/src/venv/lib/python2.7/posixpath.py", line 77, in join
elif path == '' or path.endswith('/'):
AttributeError: 'NoneType' object has no attribute 'endswith'
【问题讨论】: