django-pipeline
django-pipeline copied to clipboard
StaticLiveServerTestCase can not load static files
I use selenium
for the functional test. I also use django-pipeline
for loading static fils.
Problem is that selenium with StaticLiveServerTestCase
(from django.contrib.staticfiles.testing import StaticLiveServerTestCase
) could not load static files.
ref : http://stackoverflow.com/questions/39762920/django-functional-test-selenium-live-server-url-doesnt-load-static-files
Same issue. @rightx2 did you find a workaround?
Same here.
@rightx2 @lynnco do you have any news on this one?
Same here. Is there any update for this?
I finally fixed my problem. I directly modified django.conf.settings.DEBUG
directly, rather than using override_settings(DEBUD=True)
before. After I changed to use override_settings(DEBUD=True)
, I fixed the problem.
I think it's not a issue of django-pipeline
. I suspect that it's an internal change of django make the behavior of my tests not working anymore in 1.11. It does work in 1.8, though.
It may be related to https://code.djangoproject.com/ticket/29353, which was already fixed.
This is still broken
I fixed this with:
- Extending
LiveServerTestCase
insead ofStaticLiveServerTestCase
- Adding this to my test
@classmethod
def setUpClass(cls):
super().setUpClass()
call_command('collectstatic', '--noinput')