Hi,


I am able to spawn a separate live development server process for a 
selenium test which inherits from LiveServerTestCase with the following -


#globals
HTTP = "http://"# ip address of host machine on the default docker network
LOCALHOST = settings.HOST_LOCALHOST# port number on host the docker selenium 
remote server is exposed on
SEL_PORT = 4444

class SignUpViewFunctionalTests(LiveServerTestCase):

    port = 9000
    host = '0.0.0.0'
    live_server_url = HTTP + LOCALHOST + ":" + "9000"

    def setUp(self):
        settings.DEBUG = True
        self.driver = webdriver.Remote(
            HTTP + LOCALHOST + ":" + str(SEL_PORT) + "/wd/hub",
            DesiredCapabilities.CHROME
        )


This causes two parallel processes to run in the web docker container; the 
default, waiting for requests on 0.0.0.0:8000 and the process spawned when 
running the test which is listening on 0.0.0.0:9000. Via the selenium 
remote server which I connect to via RealVNC I see the Chrome browser start 
up at '172.0.17.1:9000/accounts/signup' and during the test everything 
works fine - the signed up user is created which confirms that the test 
running process is using a separate test database. The only thing I did 
notice was my static files weren't pulling through - I was using 
white-noise locally, which works fine on the default web process waiting 
for requests on 0.0.0.0:8000.

So I changed the test so that it inherits from 'StaticLiveServerTestCase' 
and it causes an error - the user is already signed up, confirming that the 
test DID NOT use a separate database.


How do I configure this so that it works with StaticLiveServerTestCase 
also? The documentation doesn't seem to say much.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/63af07ee-e794-4411-90dd-bda4523e4ede%40googlegroups.com.

Reply via email to