eggs/djangorecipe-0.20-py2.6.egg/djangorecipe/test.py
author Nishanth Amuluru <nishanth@fossee.in>
Sun, 09 Jan 2011 11:25:08 +0530
changeset 356 f88135529c74
parent 307 c6bca38c1cbf
permissions -rw-r--r--
claim task works fine now

from django.core import management

def main(settings_file, *apps):
    argv = ['test', 'test'] + list(apps)
    try:
        settings = __import__(settings_file)
        components = settings_file.split('.')
        for comp in components[1:]:
            settings = getattr(settings, comp)
    except ImportError, e:
        import sys
        sys.stderr.write("Error loading the settings module '%s': %s"
                            % (settings_file, e))
        return sys.exit(1)

    management.execute_manager(settings, argv=argv)