Ticket #2490: runtests.diff

File runtests.diff, 778 bytes (added by dev@…, 13 years ago)
  • runtests.py

     
    288288    verbosity_level = 0
    289289    if options.v:
    290290        verbosity_level = int(options.v)
     291   
    291292    if options.settings:
    292293        os.environ['DJANGO_SETTINGS_MODULE'] = options.settings
     294    elif not os.environ.has_key('DJANGO_SETTINGS_MODULE'):
     295        try:
     296            import settings
     297            os.environ['DJANGO_SETTINGS_MODULE'] = 'settings'
     298        except ImportError:
     299            parser.print_help()       
     300            print "\nERROR: No settings file found. Please use --settings=some_setting_file"
     301            sys.exit(-1)
     302   
    293303    t = TestRunner(verbosity_level, args)
    294304    t.run_tests()
Back to Top