Permalink
Browse files

Advanced deprecation warnings for Django 1.9.

  • Loading branch information...
1 parent 33457cd commit 378a0d27d630386c1b0a53d4a2d48be767453198 @timgraham timgraham committed Jan 19, 2015
Showing with 6 additions and 7 deletions.
  1. +1 −2 django/db/models/base.py
  2. +3 −3 django/utils/deprecation.py
  3. +2 −2 tests/runtests.py
View
@@ -25,7 +25,6 @@
from django.db.models.query import Q
from django.db.models.query_utils import DeferredAttribute, deferred_class_factory
from django.utils import six
-from django.utils.deprecation import RemovedInDjango19Warning
from django.utils.encoding import force_str, force_text
from django.utils.functional import curry
from django.utils.six.moves import zip
@@ -106,7 +105,7 @@ def __new__(cls, name, bases, attrs):
"This will no longer be supported in Django 1.9." %
(module, name))
if not abstract:
- warnings.warn(msg, RemovedInDjango19Warning, stacklevel=2)
+ warnings.warn(msg, DeprecationWarning, stacklevel=2)
model_module = sys.modules[new_class.__module__]
package_components = model_module.__name__.split('.')
@@ -2,15 +2,15 @@
import warnings
-class RemovedInDjango20Warning(PendingDeprecationWarning):
+class RemovedInDjango21Warning(PendingDeprecationWarning):
pass
-class RemovedInDjango19Warning(DeprecationWarning):
+class RemovedInDjango20Warning(DeprecationWarning):
pass
-RemovedInNextVersionWarning = RemovedInDjango19Warning
+RemovedInNextVersionWarning = RemovedInDjango20Warning
class warn_about_renamed_method(object):
View
@@ -15,13 +15,13 @@
from django.db import connection
from django.test import TransactionTestCase, TestCase
from django.test.utils import get_runner
-from django.utils.deprecation import RemovedInDjango19Warning, RemovedInDjango20Warning
+from django.utils.deprecation import RemovedInDjango20Warning, RemovedInDjango21Warning
from django.utils._os import upath
from django.utils import six
-warnings.simplefilter("error", RemovedInDjango19Warning)
warnings.simplefilter("error", RemovedInDjango20Warning)
+warnings.simplefilter("error", RemovedInDjango21Warning)
CONTRIB_MODULE_PATH = 'django.contrib'

0 comments on commit 378a0d2

Please sign in to comment.