2

How can I configure my Django server to run tests from tests.py when starting the server with python manage.py runserver? Right now, I have to run tests through python manage.py test articles. (Note: I am using Django 1.8)

Colby Gallup
  • 328
  • 1
  • 2
  • 10

1 Answers1

1

Answer from @limelights:

Create a bash alias or run them in sequence?

I've adapted that answer to this line of code (for bash):

alias runserver="sudo python ~/testsite/manage.py test articles; sudo python ~/testsite/manage.py runserver 192.168.1.245:90 (as one line)

Using runserver runs the test suite and opens the server. An added perk is that I can run it from any location without having to go into the ~/testsite directory.

Colby Gallup
  • 328
  • 1
  • 2
  • 10