~ubuntuone-pqm-team/django/stable

« back to all changes in this revision

Viewing changes to tests/runtests.py

  • Committer: Natalia
  • Date: 2015-12-29 23:45:16 UTC
  • Revision ID: natalia.bidart@ubuntu.com-20151229234516-i822kgwc995ia2vk
Imported Django 1.8.7 from released tarball.

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
from django.utils import six
18
18
from django.utils._os import upath
19
19
from django.utils.deprecation import (
20
 
    RemovedInDjango19Warning, RemovedInDjango20Warning,
 
20
    RemovedInDjango19Warning, RemovedInDjango110Warning,
21
21
)
22
22
 
 
23
# Make deprecation warnings errors to ensure no usage of deprecated features.
23
24
warnings.simplefilter("error", RemovedInDjango19Warning)
24
 
warnings.simplefilter("error", RemovedInDjango20Warning)
 
25
warnings.simplefilter("error", RemovedInDjango110Warning)
 
26
# Make runtime warning errors to ensure no usage of error prone patterns.
 
27
warnings.simplefilter("error", RuntimeWarning)
 
28
# Ignore known warnings in test dependencies.
 
29
warnings.filterwarnings("ignore", "'U' mode is deprecated", DeprecationWarning, module='docutils.io')
25
30
 
26
31
RUNTESTS_DIR = os.path.abspath(os.path.dirname(upath(__file__)))
27
32
 
111
116
    state = {
112
117
        'INSTALLED_APPS': settings.INSTALLED_APPS,
113
118
        'ROOT_URLCONF': getattr(settings, "ROOT_URLCONF", ""),
114
 
        # Remove the following line in Django 2.0.
115
 
        'TEMPLATE_DIRS': settings.TEMPLATE_DIRS,
116
119
        'TEMPLATES': settings.TEMPLATES,
117
120
        'LANGUAGE_CODE': settings.LANGUAGE_CODE,
118
121
        'STATIC_URL': settings.STATIC_URL,
125
128
    settings.ROOT_URLCONF = 'urls'
126
129
    settings.STATIC_URL = '/static/'
127
130
    settings.STATIC_ROOT = os.path.join(TMPDIR, 'static')
128
 
    # Remove the following line in Django 2.0.
129
 
    settings.TEMPLATE_DIRS = (TEMPLATE_DIR,)
130
131
    settings.TEMPLATES = [{
131
132
        'BACKEND': 'django.template.backends.django.DjangoTemplates',
132
133
        'DIRS': [TEMPLATE_DIR],
162
163
 
163
164
    warnings.filterwarnings(
164
165
        'ignore',
165
 
        'django.contrib.webdesign will be removed in Django 2.0.',
166
 
        RemovedInDjango20Warning
 
166
        'django.contrib.webdesign will be removed in Django 1.10.',
 
167
        RemovedInDjango110Warning
167
168
    )
168
169
 
169
170
    # Load all the ALWAYS_INSTALLED_APPS.
235
236
    state = setup(verbosity, test_labels)
236
237
    extra_tests = []
237
238
 
238
 
    if test_labels and 'postgres_tests' in test_labels and connection.vendor != 'postgres':
 
239
    if test_labels and 'postgres_tests' in test_labels and connection.vendor != 'postgresql':
239
240
        if verbosity >= 2:
240
241
            print("Removed postgres_tests from tests as we're not running with PostgreSQL.")
241
242
        test_labels.remove('postgres_tests')