diff options
| author | Tim Graham <timograham@gmail.com> | 2014-09-05 09:12:14 -0400 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2014-09-05 09:12:14 -0400 |
| commit | f8bb8436e533abad563b5235cf0e62e42dbc5f01 (patch) | |
| tree | 76182a2a7e20d002d9e30bada8df8979c27df906 | |
| parent | 344f37718b23c1749484d25458ebfda5033e1beb (diff) | |
Corrected deprecation warning silencing of SubfieldBase.
| -rw-r--r-- | tests/field_subclassing/fields.py | 10 | ||||
| -rw-r--r-- | tests/field_subclassing/models.py | 12 |
2 files changed, 10 insertions, 12 deletions
diff --git a/tests/field_subclassing/fields.py b/tests/field_subclassing/fields.py index c2158824df..b94b2372c1 100644 --- a/tests/field_subclassing/fields.py +++ b/tests/field_subclassing/fields.py @@ -1,13 +1,23 @@ from __future__ import unicode_literals import json +import warnings from django.db import models from django.utils.encoding import force_text from django.utils import six +from django.utils.deprecation import RemovedInDjango20Warning from django.utils.encoding import python_2_unicode_compatible +# Catch warning about subfieldbase -- remove in Django 2.0 +warnings.filterwarnings( + 'ignore', + 'SubfieldBase has been deprecated. Use Field.from_db_value instead.', + RemovedInDjango20Warning +) + + @python_2_unicode_compatible class Small(object): """ diff --git a/tests/field_subclassing/models.py b/tests/field_subclassing/models.py index 59712fcab3..66e765ac3e 100644 --- a/tests/field_subclassing/models.py +++ b/tests/field_subclassing/models.py @@ -1,25 +1,13 @@ """ Tests for field subclassing. """ - -import warnings - from django.db import models from django.utils.encoding import force_text -from django.utils.deprecation import RemovedInDjango20Warning from .fields import Small, SmallField, SmallerField, JSONField from django.utils.encoding import python_2_unicode_compatible -# Catch warning about subfieldbase -- remove in Django 2.0 -warnings.filterwarnings( - 'ignore', - 'SubfieldBase has been deprecated. Use Field.from_db_value instead.', - RemovedInDjango20Warning -) - - @python_2_unicode_compatible class MyModel(models.Model): name = models.CharField(max_length=10) |
