diff options
| author | Aymeric Augustin <aymeric.augustin@polyconseil.fr> | 2012-05-03 15:27:01 +0200 |
|---|---|---|
| committer | Aymeric Augustin <aymeric.augustin@polyconseil.fr> | 2012-05-03 15:27:01 +0200 |
| commit | e84f79f05113f546810c1908c7baef99fb1e874a (patch) | |
| tree | 4cb5f3e428caa894bd9acc06fc3cd6250b018715 /django/contrib | |
| parent | 227cec686e512412f613c3d14743b85445765d92 (diff) | |
Fixed #18042 -- Advanced deprecation warnings.
Thanks Ramiro for the patch.
Diffstat (limited to 'django/contrib')
| -rw-r--r-- | django/contrib/admin/templatetags/adminmedia.py | 2 | ||||
| -rw-r--r-- | django/contrib/databrowse/__init__.py | 3 | ||||
| -rw-r--r-- | django/contrib/formtools/tests/__init__.py | 9 | ||||
| -rw-r--r-- | django/contrib/formtools/wizard/legacy.py | 2 | ||||
| -rw-r--r-- | django/contrib/gis/utils/geoip.py | 2 | ||||
| -rw-r--r-- | django/contrib/localflavor/uk/forms.py | 2 | ||||
| -rw-r--r-- | django/contrib/localflavor/uk/uk_regions.py | 2 |
7 files changed, 15 insertions, 7 deletions
diff --git a/django/contrib/admin/templatetags/adminmedia.py b/django/contrib/admin/templatetags/adminmedia.py index 753c180b02..b08d13c18f 100644 --- a/django/contrib/admin/templatetags/adminmedia.py +++ b/django/contrib/admin/templatetags/adminmedia.py @@ -11,5 +11,5 @@ def admin_media_prefix(): """ warnings.warn( "The admin_media_prefix template tag is deprecated. " - "Use the static template tag instead.", PendingDeprecationWarning) + "Use the static template tag instead.", DeprecationWarning) return PrefixNode.handle_simple("ADMIN_MEDIA_PREFIX") diff --git a/django/contrib/databrowse/__init__.py b/django/contrib/databrowse/__init__.py index 24098b013d..acb7626c8d 100644 --- a/django/contrib/databrowse/__init__.py +++ b/django/contrib/databrowse/__init__.py @@ -2,5 +2,4 @@ import warnings from django.contrib.databrowse.sites import DatabrowsePlugin, ModelDatabrowse, DatabrowseSite, site -warnings.warn("The Databrowse contrib app is deprecated", - PendingDeprecationWarning) +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 index e628690491..96d1dda625 100644 --- a/django/contrib/formtools/tests/__init__.py +++ b/django/contrib/formtools/tests/__init__.py @@ -7,6 +7,7 @@ from django.conf import settings from django.contrib.formtools import preview, utils from django.contrib.formtools.wizard import FormWizard from django.test import TestCase +from django.test.utils import get_warnings_state, restore_warnings_state from django.test.utils import override_settings from django.utils import unittest @@ -40,12 +41,20 @@ class PreviewTests(TestCase): def setUp(self): super(PreviewTests, self).setUp() + self.save_warnings_state() + warnings.filterwarnings('ignore', category=DeprecationWarning, + module='django.contrib.formtools.wizard.legacy') + # Create a FormPreview instance to share between tests self.preview = preview.FormPreview(TestForm) input_template = '<input type="hidden" name="%s" value="%s" />' self.input = input_template % (self.preview.unused_name('stage'), "%d") self.test_data = {'field1':u'foo', 'field1_':u'asdf'} + def tearDown(self): + super(PreviewTests, self).tearDown() + self.restore_warnings_state() + def test_unused_name(self): """ Verifies name mangling to get uniue field name. diff --git a/django/contrib/formtools/wizard/legacy.py b/django/contrib/formtools/wizard/legacy.py index 532635a3d9..d07e959de0 100644 --- a/django/contrib/formtools/wizard/legacy.py +++ b/django/contrib/formtools/wizard/legacy.py @@ -39,7 +39,7 @@ class FormWizard(object): warnings.warn( 'Old-style form wizards have been deprecated; use the class-based ' 'views in django.contrib.formtools.wizard.views instead.', - PendingDeprecationWarning) + DeprecationWarning) def __repr__(self): 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 index 2d3b2ae4e6..781917e4c9 100644 --- a/django/contrib/gis/utils/geoip.py +++ b/django/contrib/gis/utils/geoip.py @@ -10,5 +10,5 @@ if HAS_GEOIP: def __init__(self, *args, **kwargs): warnings.warn('GeoIP class has been moved to `django.contrib.gis.geoip`, and ' 'this shortcut will disappear in Django v1.6.', - PendingDeprecationWarning, stacklevel=2) + DeprecationWarning, stacklevel=2) super(GeoIP, self).__init__(*args, **kwargs) diff --git a/django/contrib/localflavor/uk/forms.py b/django/contrib/localflavor/uk/forms.py index 60e63fb490..14624bc15f 100644 --- a/django/contrib/localflavor/uk/forms.py +++ b/django/contrib/localflavor/uk/forms.py @@ -3,7 +3,7 @@ from django.contrib.localflavor.gb import forms import warnings warnings.warn( 'The "UK" prefix for United Kingdom has been deprecated in favour of the ' - 'GB code. Please use the new GB-prefixed names.', PendingDeprecationWarning) + 'GB code. Please use the new GB-prefixed names.', DeprecationWarning) UKPostcodeField = forms.GBPostcodeField UKCountySelect = forms.GBCountySelect diff --git a/django/contrib/localflavor/uk/uk_regions.py b/django/contrib/localflavor/uk/uk_regions.py index 25d056c653..5af19967c7 100644 --- a/django/contrib/localflavor/uk/uk_regions.py +++ b/django/contrib/localflavor/uk/uk_regions.py @@ -6,7 +6,7 @@ from django.contrib.localflavor.gb.gb_regions import ( import warnings warnings.warn( 'The "UK" prefix for United Kingdom has been deprecated in favour of the ' - 'GB code. Please use the new GB-prefixed names.', PendingDeprecationWarning) + 'GB code. Please use the new GB-prefixed names.', DeprecationWarning) UK_NATIONS_CHOICES = GB_NATIONS_CHOICES UK_REGION_CHOICES = GB_REGION_CHOICES |
