Skip to content

Instantly share code, notes, and snippets.

@liorsion
Created March 16, 2011 20:24
Show Gist options
  • Select an option

  • Save liorsion/873231 to your computer and use it in GitHub Desktop.

Select an option

Save liorsion/873231 to your computer and use it in GitHub Desktop.
from django.core.management.base import AppCommand, BaseCommand
from django.core.management import call_command
from django.conf import settings
class Command(BaseCommand):
def handle(self, *args, **options):
test_app_path = ()
for app in settings.MY_INSTALLED_APPS:
test_app = app.split('.')
if len(test_app) > 1:
test_app = (test_app[-1],)
else:
test_app = (app,)
test_app_path += test_app
call_command("test",*test_app_path, **options)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment