Skip to content

Instantly share code, notes, and snippets.

@matwey
Created April 3, 2016 12:38
Show Gist options
  • Select an option

  • Save matwey/543c8963d2470226e9ae2ce5ea5f970b to your computer and use it in GitHub Desktop.

Select an option

Save matwey/543c8963d2470226e9ae2ce5ea5f970b to your computer and use it in GitHub Desktop.
DRF LiveServerTest
#!/usr/bin/env python
import os
import sys
def runtests():
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "tests.test_settings")
try:
from django import setup
setup()
except ImportError:
pass
from django.core.management import call_command
os.sys.exit(call_command("test", "tests.test_all", verbosity=2))
if __name__ == "__main__":
runtests()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment