#!/usr/bin/env python

import os
from django.core.management import call_command


if __name__ == '__main__':
    os.environ['DJANGO_SETTINGS_MODULE'] = 'tests.settings'

    import django
    if hasattr(django, 'setup'):
        django.setup()

    call_command('test', nomigrations=True)

#!/usr/bin/env python

import os
from django.core.management import execute_from_command_line


if __name__ == '__main__':
    os.environ['DJANGO_SETTINGS_MODULE'] = 'tests.settings'

    execute_from_command_line(['manage.py', 'test', '--nomigrations'])

Use a higher level command line api
Use a higher level command line api