Django

Code

Changeset 463

Show
Ignore:
Timestamp:
08/10/05 10:36:16 (3 years ago)
Author:
adrian
Message:

Fixed #297 -- Added a '--settings' option to runtests.py

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/trunk/tests/runtests.py

    r446 r463  
    5454        from django.core.db import db 
    5555        from django.core import management, meta 
     56 
     57        self.output(0, "Running tests with database %r" % settings.DATABASE_ENGINE) 
    5658 
    5759        # Manually set INSTALLED_APPS to point to the test app. 
     
    177179    parser.add_option('-v', help='How verbose should the output be? Choices are 0, 1 and 2, where 2 is most verbose. Default is 0.', 
    178180        type='choice', choices=['0', '1', '2']) 
     181    parser.add_option('--settings', 
     182        help='Python path to settings module, e.g. "myproject.settings.main". If this isn\'t provided, the DJANGO_SETTINGS_MODULE environment variable will be used.') 
    179183    options, args = parser.parse_args() 
    180184    verbosity_level = 0 
    181185    if options.v: 
    182186        verbosity_level = int(options.v) 
     187    if options.settings: 
     188        os.environ['DJANGO_SETTINGS_MODULE'] = options.settings 
    183189    t = TestRunner(verbosity_level) 
    184190    t.run_tests()