1

When I test my Django web application with python manage.py test, this starts Django's development server and runs the test.

I want to run my Django tests on my production stack. Specifically, I want to use Apache instead of Django's development server. Is there a way to do this?

I've looked through the docs for LiveServerTestCase, but it doesn't seem to be customizable in this regard.

Travis
  • 1,998
  • 1
  • 21
  • 36

1 Answers1

1

The LiveServerTestCase launches a Django server. You can then test it using a client like selenium.

In your case, you are already running the production server that you want to test, that means you don't require the Django server of LiveServerTestCase, or the fixture loading of TestCase. Just use SimpleTestCase. You can then test the live server using a client like selenium.

The Django docs demonstrate how to use selenium. In your case, you just need to set self.live_server_url to the domain that Apache is running on.

Alasdair
  • 298,606
  • 55
  • 578
  • 516