#22544: Error happened when I use LiveServerTestCase to test static file
-----------------------------------+------------------------
Reporter: lifeng | Owner: nobody
Type: Bug | Status: new
Component: Testing framework | Version: 1.7-beta-2
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 1 | UI/UX: 0
-----------------------------------+------------------------
I know I should use StaticLiveServerCase to test static file, and when I
use it, everything is OK. But when I use LiveServerTestCase to test static
file, some error occurred. Bellow is the error message:
{{{
TypeError: unsupported operand type(s) for +=: 'NoneType' and 'str'
.Traceback (most recent call last):
File "/usr/lib/python3.3/wsgiref/handlers.py", line 137, in run
self.result = application(self.environ, self.start_response)
File "/home/lf/.virtualenvs/django1.7/lib/python3.3/site-
packages/django/test/testcases.py", line 1011, in __call__
return super(FSFilesHandler, self).__call__(environ, start_response)
File "/home/lf/.virtualenvs/django1.7/lib/python3.3/site-
packages/django/core/handlers/wsgi.py", line 187, in __call__
response = self.get_response(request)
File "/home/lf/.virtualenvs/django1.7/lib/python3.3/site-
packages/django/test/testcases.py", line 994, in get_response
return self.serve(request)
File "/home/lf/.virtualenvs/django1.7/lib/python3.3/site-
packages/django/test/testcases.py", line 1006, in serve
return serve(request, final_rel_path,
document_root=self.get_base_dir())
File "/home/lf/.virtualenvs/django1.7/lib/python3.3/site-
packages/django/views/static.py", line 50, in serve
fullpath = os.path.join(document_root, newpath)
File "/home/lf/.virtualenvs/django1.7/lib/python3.3/posixpath.py", line
83, in join
path += b
}}}
The document_root is None, Is there anything wrong in
[https://github.com/django/django/blob/stable/1.7.x/django/test/testcases.py#L993]
--
Ticket URL: <https://code.djangoproject.com/ticket/22544>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/049.869b4f814f775a7194c2ed96b9d96237%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.