~ubuntu-branches/ubuntu/quantal/python-django/quantal

« back to all changes in this revision

Viewing changes to tests/runtests.py

  • Committer: Bazaar Package Importer
  • Author(s): Jamie Strandboge
  • Date: 2010-10-12 11:34:35 UTC
  • mfrom: (1.1.12 upstream) (29.1.1 maverick-security)
  • Revision ID: james.westby@ubuntu.com-20101012113435-yy57c8tx6g9anf3e
Tags: 1.2.3-1ubuntu0.1
* SECURITY UPDATE: XSS in CSRF protections. New upstream release
  - CVE-2010-3082
* debian/patches/01_disable_url_verify_regression_tests.diff:
  - updated to disable another test that fails without internet connection
  - patch based on work by Kai Kasurinen and Krzysztof Klimonda
* debian/control: don't Build-Depends on locales-all, which doesn't exist
  in maverick

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
    'django.contrib.messages',
28
28
    'django.contrib.comments',
29
29
    'django.contrib.admin',
 
30
    'django.contrib.admindocs',
30
31
]
31
32
 
32
33
def get_test_models():
121
122
    get_apps()
122
123
 
123
124
    # Load all the test model apps.
 
125
    test_labels_set = set([label.split('.')[0] for label in test_labels])
124
126
    for model_dir, model_name in get_test_models():
125
127
        model_label = '.'.join([model_dir, model_name])
126
 
        try:
127
 
            # if the model was named on the command line, or
128
 
            # no models were named (i.e., run all), import
129
 
            # this model and add it to the list to test.
130
 
            if not test_labels or model_name in set([label.split('.')[0] for label in test_labels]):
131
 
                if verbosity >= 1:
132
 
                    print "Importing model %s" % model_name
133
 
                mod = load_app(model_label)
134
 
                if mod:
135
 
                    if model_label not in settings.INSTALLED_APPS:
136
 
                        settings.INSTALLED_APPS.append(model_label)
137
 
        except Exception, e:
138
 
            sys.stderr.write("Error while importing %s:" % model_name + ''.join(traceback.format_exception(*sys.exc_info())[1:]))
139
 
            continue
 
128
        # if the model was named on the command line, or
 
129
        # no models were named (i.e., run all), import
 
130
        # this model and add it to the list to test.
 
131
        if not test_labels or model_name in test_labels_set:
 
132
            if verbosity >= 1:
 
133
                print "Importing model %s" % model_name
 
134
            mod = load_app(model_label)
 
135
            if mod:
 
136
                if model_label not in settings.INSTALLED_APPS:
 
137
                    settings.INSTALLED_APPS.append(model_label)
140
138
 
141
139
    # Add tests for invalid models.
142
140
    extra_tests = []