I’ve built up a suite of unit tests for my django project — running them against the local test server works fine.
Now that I’ve deployed the code to a production environment, I would like to reuse those tests against a remote server (mostly to catch any config bugs etc).
django-admin test ...
doesn’t seem to offer any options for specifying the target server, and I would rather not rewrite/fork the tests.
Is there a good way of running django unit tests against a remote server? I couldn’t find anything in the docs / SO / google..
That’s not what unit tests are for.
Unit tests don’t run “against” a particular server. In fact, no server is really involved at all – the test client simulates a server when you do
client.get(url), but actually calls the code directly.If you want to test your code running in different environments, you need to use an integration test framework – something like robotframework in conjunction with Selenium, for example.