Run LiveServerTestCase from Docker Selenium with Django 1.11

Viewed 1563

Since Django 1.11, the option --liveserver was removed from the manage.py test command.

I was using this option to allow the liveserver to be reach from the ip address of the machine rather than the localhost with the following command:

./manage.py test --liveserver=0.0.0.0:8000

Unfortunately, this option is gone and I'm looking for a new solution to allow my Docker Selenium image to access my LiveServerTestCase during the tests.

3 Answers

Using the StaticLiveServerTestCase doesn't seem to be necessary: the same approach works with its parent class:

class End2End(LiveServerTestCase):  
    host = '0.0.0.0'  # or socket.gethostbyname(...) like @VivienCormier did
Related