-
diff --git a/django/conf/__init__.py b/django/conf/__init__.py
a
|
b
|
|
181 | 181 | "handler: adding implicit debug-false-only filter. " |
182 | 182 | "See http://docs.djangoproject.com/en/dev/releases/1.4/" |
183 | 183 | "#request-exceptions-are-now-always-logged", |
184 | | PendingDeprecationWarning) |
| 184 | DeprecationWarning) |
185 | 185 | |
186 | 186 | filter_name = "require_debug_false" |
187 | 187 | |
-
diff --git a/django/conf/urls/defaults.py b/django/conf/urls/defaults.py
a
|
b
|
|
1 | 1 | import warnings |
2 | 2 | warnings.warn("django.conf.urls.defaults is deprecated; use django.conf.urls instead", |
3 | | PendingDeprecationWarning) |
| 3 | DeprecationWarning) |
4 | 4 | |
5 | 5 | from django.conf.urls import (handler403, handler404, handler500, |
6 | 6 | include, patterns, url) |
-
diff --git a/django/contrib/admin/templatetags/adminmedia.py b/django/contrib/admin/templatetags/adminmedia.py
a
|
b
|
|
11 | 11 | """ |
12 | 12 | warnings.warn( |
13 | 13 | "The admin_media_prefix template tag is deprecated. " |
14 | | "Use the static template tag instead.", PendingDeprecationWarning) |
| 14 | "Use the static template tag instead.", DeprecationWarning) |
15 | 15 | return PrefixNode.handle_simple("ADMIN_MEDIA_PREFIX") |
-
diff --git a/django/contrib/databrowse/__init__.py b/django/contrib/databrowse/__init__.py
a
|
b
|
|
2 | 2 | from django.contrib.databrowse.sites import DatabrowsePlugin, ModelDatabrowse, DatabrowseSite, site |
3 | 3 | |
4 | 4 | |
5 | | warnings.warn("The Databrowse contrib app is deprecated", |
6 | | PendingDeprecationWarning) |
| 5 | warnings.warn("The Databrowse contrib app is deprecated", DeprecationWarning) |
-
diff --git a/django/contrib/formtools/tests/__init__.py b/django/contrib/formtools/tests/__init__.py
a
|
b
|
|
50 | 50 | self.save_warnings_state() |
51 | 51 | warnings.filterwarnings('ignore', category=DeprecationWarning, |
52 | 52 | module='django.contrib.formtools.utils') |
| 53 | warnings.filterwarnings('ignore', category=DeprecationWarning, |
| 54 | module='django.contrib.formtools.wizard.legacy') |
53 | 55 | |
54 | 56 | # Create a FormPreview instance to share between tests |
55 | 57 | self.preview = preview.FormPreview(TestForm) |
-
diff --git a/django/contrib/formtools/wizard/legacy.py b/django/contrib/formtools/wizard/legacy.py
a
|
b
|
|
39 | 39 | warnings.warn( |
40 | 40 | 'Old-style form wizards have been deprecated; use the class-based ' |
41 | 41 | 'views in django.contrib.formtools.wizard.views instead.', |
42 | | PendingDeprecationWarning) |
| 42 | DeprecationWarning) |
43 | 43 | |
44 | 44 | def __repr__(self): |
45 | 45 | return "step: %d\nform_list: %s\ninitial_data: %s" % (self.step, self.form_list, self.initial) |
-
diff --git a/django/contrib/gis/utils/geoip.py b/django/contrib/gis/utils/geoip.py
a
|
b
|
|
10 | 10 | def __init__(self, *args, **kwargs): |
11 | 11 | warnings.warn('GeoIP class has been moved to `django.contrib.gis.geoip`, and ' |
12 | 12 | 'this shortcut will disappear in Django v1.6.', |
13 | | PendingDeprecationWarning, stacklevel=2) |
| 13 | DeprecationWarning, stacklevel=2) |
14 | 14 | super(GeoIP, self).__init__(*args, **kwargs) |
-
diff --git a/django/contrib/localflavor/uk/forms.py b/django/contrib/localflavor/uk/forms.py
a
|
b
|
|
3 | 3 | import warnings |
4 | 4 | warnings.warn( |
5 | 5 | 'The "UK" prefix for United Kingdom has been deprecated in favour of the ' |
6 | | 'GB code. Please use the new GB-prefixed names.', PendingDeprecationWarning) |
| 6 | 'GB code. Please use the new GB-prefixed names.', DeprecationWarning) |
7 | 7 | |
8 | 8 | UKPostcodeField = forms.GBPostcodeField |
9 | 9 | UKCountySelect = forms.GBCountySelect |
-
diff --git a/django/contrib/localflavor/uk/uk_regions.py b/django/contrib/localflavor/uk/uk_regions.py
a
|
b
|
|
6 | 6 | import warnings |
7 | 7 | warnings.warn( |
8 | 8 | 'The "UK" prefix for United Kingdom has been deprecated in favour of the ' |
9 | | 'GB code. Please use the new GB-prefixed names.', PendingDeprecationWarning) |
| 9 | 'GB code. Please use the new GB-prefixed names.', DeprecationWarning) |
10 | 10 | |
11 | 11 | UK_NATIONS_CHOICES = GB_NATIONS_CHOICES |
12 | 12 | UK_REGION_CHOICES = GB_REGION_CHOICES |
-
diff --git a/django/core/cache/backends/memcached.py b/django/core/cache/backends/memcached.py
a
|
b
|
|
130 | 130 | import warnings |
131 | 131 | warnings.warn( |
132 | 132 | "memcached.CacheClass has been split into memcached.MemcachedCache and memcached.PyLibMCCache. Please update your cache backend setting.", |
133 | | PendingDeprecationWarning |
| 133 | DeprecationWarning |
134 | 134 | ) |
135 | 135 | try: |
136 | 136 | import memcache |
-
diff --git a/django/core/management/__init__.py b/django/core/management/__init__.py
a
|
b
|
|
395 | 395 | "you likely need to update your 'manage.py'; " |
396 | 396 | "please see the Django 1.4 release notes " |
397 | 397 | "(https://docs.djangoproject.com/en/dev/releases/1.4/).", |
398 | | PendingDeprecationWarning) |
| 398 | DeprecationWarning) |
399 | 399 | |
400 | 400 | # Add this project to sys.path so that it's importable in the conventional |
401 | 401 | # way. For example, if this file (manage.py) lives in a directory |
… |
… |
|
451 | 451 | "you likely need to update your 'manage.py'; " |
452 | 452 | "please see the Django 1.4 release notes " |
453 | 453 | "(https://docs.djangoproject.com/en/dev/releases/1.4/).", |
454 | | PendingDeprecationWarning) |
| 454 | DeprecationWarning) |
455 | 455 | |
456 | 456 | setup_environ(settings_mod) |
457 | 457 | utility = ManagementUtility(argv) |
-
diff --git a/django/http/__init__.py b/django/http/__init__.py
a
|
b
|
|
297 | 297 | |
298 | 298 | @property |
299 | 299 | def raw_post_data(self): |
300 | | warnings.warn('HttpRequest.raw_post_data has been deprecated. Use HttpRequest.body instead.', PendingDeprecationWarning) |
| 300 | warnings.warn('HttpRequest.raw_post_data has been deprecated. Use HttpRequest.body instead.', DeprecationWarning) |
301 | 301 | return self.body |
302 | 302 | |
303 | 303 | def _mark_post_parse_error(self): |
-
diff --git a/django/middleware/common.py b/django/middleware/common.py
a
|
b
|
|
130 | 130 | if getattr(settings, 'IGNORABLE_404_STARTS', ()): |
131 | 131 | import warnings |
132 | 132 | warnings.warn('The IGNORABLE_404_STARTS setting has been deprecated ' |
133 | | 'in favor of IGNORABLE_404_URLS.', |
134 | | PendingDeprecationWarning) |
| 133 | 'in favor of IGNORABLE_404_URLS.', DeprecationWarning) |
135 | 134 | for start in settings.IGNORABLE_404_STARTS: |
136 | 135 | if uri.startswith(start): |
137 | 136 | return True |
138 | 137 | if getattr(settings, 'IGNORABLE_404_ENDS', ()): |
139 | 138 | import warnings |
140 | 139 | warnings.warn('The IGNORABLE_404_ENDS setting has been deprecated ' |
141 | | 'in favor of IGNORABLE_404_URLS.', |
142 | | PendingDeprecationWarning) |
| 140 | 'in favor of IGNORABLE_404_URLS.', DeprecationWarning) |
143 | 141 | for end in settings.IGNORABLE_404_ENDS: |
144 | 142 | if uri.endswith(end): |
145 | 143 | return True |
-
diff --git a/django/template/defaultfilters.py b/django/template/defaultfilters.py
a
|
b
|
|
53 | 53 | warnings.warn("Setting the %s attribute of a template filter " |
54 | 54 | "function is deprecated; use @register.filter(%s=%s) " |
55 | 55 | "instead" % (attr, attr, getattr(func, attr)), |
56 | | PendingDeprecationWarning) |
| 56 | DeprecationWarning) |
57 | 57 | setattr(_dec, attr, getattr(func, attr)) |
58 | 58 | |
59 | 59 | return wraps(func)(_dec) |
-
diff --git a/django/utils/copycompat.py b/django/utils/copycompat.py
a
|
b
|
|
7 | 7 | import warnings |
8 | 8 | |
9 | 9 | warnings.warn("django.utils.copycompat is deprecated; use the native copy module instead", |
10 | | PendingDeprecationWarning) |
| 10 | DeprecationWarning) |
11 | 11 | |
12 | 12 | # Monkeypatch copy's deepcopy registry to handle functions correctly. |
13 | 13 | if (hasattr(copy, '_deepcopy_dispatch') and types.FunctionType not in copy._deepcopy_dispatch): |
-
diff --git a/django/utils/hashcompat.py b/django/utils/hashcompat.py
a
|
b
|
|
6 | 6 | |
7 | 7 | import warnings |
8 | 8 | warnings.warn("django.utils.hashcompat is deprecated; use hashlib instead", |
9 | | PendingDeprecationWarning) |
| 9 | DeprecationWarning) |
10 | 10 | |
11 | 11 | import hashlib |
12 | 12 | md5_constructor = hashlib.md5 |
-
diff --git a/django/utils/itercompat.py b/django/utils/itercompat.py
a
|
b
|
|
26 | 26 | |
27 | 27 | def all(iterable): |
28 | 28 | warnings.warn("django.utils.itercompat.all is deprecated; use the native version instead", |
29 | | PendingDeprecationWarning) |
| 29 | DeprecationWarning) |
30 | 30 | return __builtin__.all(iterable) |
31 | 31 | |
32 | 32 | def any(iterable): |
33 | 33 | warnings.warn("django.utils.itercompat.any is deprecated; use the native version instead", |
34 | | PendingDeprecationWarning) |
| 34 | DeprecationWarning) |
35 | 35 | return __builtin__.any(iterable) |
-
diff --git a/django/utils/text.py b/django/utils/text.py
a
|
b
|
|
206 | 206 | |
207 | 207 | def truncate_words(s, num, end_text='...'): |
208 | 208 | warnings.warn('This function has been deprecated. Use the Truncator class ' |
209 | | 'in django.utils.text instead.', category=PendingDeprecationWarning) |
| 209 | 'in django.utils.text instead.', category=DeprecationWarning) |
210 | 210 | truncate = end_text and ' %s' % end_text or '' |
211 | 211 | return Truncator(s).words(num, truncate=truncate) |
212 | 212 | truncate_words = allow_lazy(truncate_words, unicode) |
213 | 213 | |
214 | 214 | def truncate_html_words(s, num, end_text='...'): |
215 | 215 | warnings.warn('This function has been deprecated. Use the Truncator class ' |
216 | | 'in django.utils.text instead.', category=PendingDeprecationWarning) |
| 216 | 'in django.utils.text instead.', category=DeprecationWarning) |
217 | 217 | truncate = end_text and ' %s' % end_text or '' |
218 | 218 | return Truncator(s).words(num, truncate=truncate, html=True) |
219 | 219 | truncate_html_words = allow_lazy(truncate_html_words, unicode) |
-
diff --git a/django/views/decorators/cache.py b/django/views/decorators/cache.py
a
|
b
|
|
44 | 44 | warnings.warn('The cache_page decorator must be called like: ' |
45 | 45 | 'cache_page(timeout, [cache=cache name], [key_prefix=key prefix]). ' |
46 | 46 | 'All other ways are deprecated.', |
47 | | PendingDeprecationWarning, |
48 | | stacklevel=3) |
| 47 | DeprecationWarning, |
| 48 | stacklevel=2) |
49 | 49 | |
50 | 50 | if len(args) > 1: |
51 | 51 | assert len(args) == 2, "cache_page accepts at most 2 arguments" |
-
diff --git a/django/views/decorators/csrf.py b/django/views/decorators/csrf.py
a
|
b
|
|
55 | 55 | """ |
56 | 56 | warnings.warn("csrf_response_exempt is deprecated. It no longer performs a " |
57 | 57 | "function, and calls to it can be removed.", |
58 | | PendingDeprecationWarning) |
| 58 | DeprecationWarning) |
59 | 59 | return view_func |
60 | 60 | |
61 | 61 | def csrf_view_exempt(view_func): |
… |
… |
|
63 | 63 | Marks a view function as being exempt from CSRF view protection. |
64 | 64 | """ |
65 | 65 | warnings.warn("csrf_view_exempt is deprecated. Use csrf_exempt instead.", |
66 | | PendingDeprecationWarning) |
| 66 | DeprecationWarning) |
67 | 67 | return csrf_exempt(view_func) |
68 | 68 | |
69 | 69 | def csrf_exempt(view_func): |
-
diff --git a/tests/regressiontests/cache/tests.py b/tests/regressiontests/cache/tests.py
a
|
b
|
|
1442 | 1442 | ) |
1443 | 1443 | class CacheMiddlewareTest(TestCase): |
1444 | 1444 | |
| 1445 | # The following tests will need to be modified in Django 1.6 to not use |
| 1446 | # deprecated ways of using the cache_page decorator that will be removed in |
| 1447 | # such version |
1445 | 1448 | def setUp(self): |
1446 | 1449 | self.factory = RequestFactory() |
1447 | 1450 | self.default_cache = get_cache('default') |
1448 | 1451 | self.other_cache = get_cache('other') |
| 1452 | self.save_warnings_state() |
| 1453 | warnings.filterwarnings('ignore', category=DeprecationWarning, module='django.views.decorators.cache') |
1449 | 1454 | |
1450 | 1455 | def tearDown(self): |
| 1456 | self.restore_warnings_state() |
1451 | 1457 | self.default_cache.clear() |
1452 | 1458 | self.other_cache.clear() |
1453 | 1459 | |
-
diff --git a/tests/regressiontests/decorators/tests.py b/tests/regressiontests/decorators/tests.py
a
|
b
|
|
70 | 70 | |
71 | 71 | def setUp(self): |
72 | 72 | self.warning_state = get_warnings_state() |
73 | | warnings.filterwarnings('ignore', category=PendingDeprecationWarning, |
| 73 | warnings.filterwarnings('ignore', category=DeprecationWarning, |
74 | 74 | module='django.views.decorators.cache') |
75 | 75 | |
76 | 76 | def tearDown(self): |
-
diff --git a/tests/regressiontests/logging_tests/tests.py b/tests/regressiontests/logging_tests/tests.py
a
|
b
|
|
1 | 1 | import copy |
| 2 | import warnings |
2 | 3 | |
3 | 4 | from django.conf import compat_patch_logging_config |
4 | 5 | from django.core import mail |
5 | 6 | from django.test import TestCase, RequestFactory |
6 | | from django.test.utils import override_settings |
| 7 | from django.test.utils import override_settings, get_warnings_state, restore_warnings_state |
7 | 8 | from django.utils.log import CallbackFilter, RequireDebugFalse, getLogger |
8 | 9 | |
9 | 10 | |
… |
… |
|
40 | 41 | |
41 | 42 | """ |
42 | 43 | config = copy.deepcopy(OLD_LOGGING) |
43 | | compat_patch_logging_config(config) |
| 44 | |
| 45 | warnings_state = get_warnings_state() |
| 46 | warnings.filterwarnings('ignore', category=DeprecationWarning, module='django.conf') |
| 47 | try: |
| 48 | compat_patch_logging_config(config) |
| 49 | finally: |
| 50 | restore_warnings_state(warnings_state) |
44 | 51 | |
45 | 52 | self.assertEqual( |
46 | 53 | config["handlers"]["mail_admins"]["filters"], |
-
diff --git a/tests/regressiontests/requests/tests.py b/tests/regressiontests/requests/tests.py
a
|
b
|
|
420 | 420 | 'CONTENT_LENGTH': len(payload), |
421 | 421 | 'wsgi.input': ExplodingStringIO(payload)}) |
422 | 422 | |
423 | | with self.assertRaises(UnreadablePostError): |
424 | | request.raw_post_data |
| 423 | warnings_state = get_warnings_state() |
| 424 | warnings.filterwarnings('ignore', category=DeprecationWarning, module='django.http') |
| 425 | try: |
| 426 | with self.assertRaises(UnreadablePostError): |
| 427 | request.raw_post_data |
| 428 | finally: |
| 429 | restore_warnings_state(warnings_state) |
-
diff --git a/tests/regressiontests/settings_tests/tests.py b/tests/regressiontests/settings_tests/tests.py
a
|
b
|
|
1 | 1 | import os |
| 2 | import warnings |
2 | 3 | |
3 | 4 | from django.conf import settings, global_settings |
4 | 5 | from django.core.exceptions import ImproperlyConfigured |
… |
… |
|
274 | 275 | Ensures proper settings file is used in setup_environ if |
275 | 276 | DJANGO_SETTINGS_MODULE is set in the environment. |
276 | 277 | """ |
| 278 | # Decide what to do with these tests when setup_environ() gets removed in Django 1.6 |
277 | 279 | def setUp(self): |
278 | 280 | self.original_value = os.environ.get('DJANGO_SETTINGS_MODULE') |
| 281 | self.save_warnings_state() |
| 282 | warnings.filterwarnings('ignore', category=DeprecationWarning, module='django.core.management') |
279 | 283 | |
280 | 284 | def tearDown(self): |
| 285 | self.restore_warnings_state() |
281 | 286 | if self.original_value: |
282 | 287 | os.environ['DJANGO_SETTINGS_MODULE'] = self.original_value |
283 | 288 | elif 'DJANGO_SETTINGS_MODULE' in os.environ: |
-
diff --git a/tests/regressiontests/utils/text.py b/tests/regressiontests/utils/text.py
a
|
b
|
|
1 | 1 | # -*- coding: utf-8 -*- |
2 | | import unittest |
| 2 | import warnings |
3 | 3 | |
| 4 | from django.test import SimpleTestCase |
4 | 5 | from django.utils import text |
5 | 6 | |
6 | | class TestUtilsText(unittest.TestCase): |
| 7 | class TestUtilsText(SimpleTestCase): |
| 8 | |
| 9 | # In Django 1.6 truncate_words() and truncate_html_words() will be removed |
| 10 | # so these tests will need to be adapted accordingly |
| 11 | def setUp(self): |
| 12 | self.save_warnings_state() |
| 13 | warnings.filterwarnings('ignore', category=DeprecationWarning, module='django.utils.text') |
| 14 | |
| 15 | def tearDown(self): |
| 16 | self.restore_warnings_state() |
7 | 17 | |
8 | 18 | def test_truncate_chars(self): |
9 | 19 | truncator = text.Truncator( |
-
diff --git a/tests/runtests.py b/tests/runtests.py
a
|
b
|
|
10 | 10 | |
11 | 11 | # databrowse is deprecated, but we still want to run its tests |
12 | 12 | warnings.filterwarnings('ignore', "The Databrowse contrib app is deprecated", |
13 | | PendingDeprecationWarning, 'django.contrib.databrowse') |
| 13 | DeprecationWarning, 'django.contrib.databrowse') |
14 | 14 | |
15 | 15 | CONTRIB_DIR_NAME = 'django.contrib' |
16 | 16 | MODEL_TESTS_DIR_NAME = 'modeltests' |