Ticket #582: template_eggs-runtests.patch

File template_eggs-runtests.patch, 1.3 KB (added by sune.kirkeby@…, 19 years ago)

Add app-egg to test environment

  • tests/runtests.py

     
    77# and Django aims to work with Python 2.3+.
    88import doctest
    99
    10 APP_NAME = 'testapp'
     10TEST_APPS = ('testapp', 'omelet')
    1111OTHER_TESTS_DIR = "othertests"
    1212TEST_DATABASE_NAME = 'django_test_db'
    1313
     
    1818        'description': description,
    1919    })
    2020
    21 MODEL_DIR = os.path.join(os.path.dirname(__file__), APP_NAME, 'models')
     21MODEL_DIR = os.path.join(os.path.dirname(__file__), TEST_APPS[0], 'models')
    2222
    2323def get_test_models():
    2424    return [f[:-3] for f in os.listdir(MODEL_DIR) if f.endswith('.py') and not f.startswith('__init__')]
     
    6868        from django.core import management, meta
    6969
    7070        # Manually set INSTALLED_APPS to point to the test app.
    71         settings.INSTALLED_APPS = (APP_NAME,)
     71        settings.INSTALLED_APPS = TEST_APPS
    7272
    7373        # Determine which models we're going to test.
    7474        test_models = get_test_models()
     
    212212        verbosity_level = int(options.v)
    213213    if options.settings:
    214214        os.environ['DJANGO_SETTINGS_MODULE'] = options.settings
     215    sys.path.append(os.path.abspath('omelet.egg'))
    215216    t = TestRunner(verbosity_level, args)
    216217    t.run_tests()
Back to Top