Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Advanced deprecations in core.mail, core.commands, core.context_proce…

…ssors and core.handlers.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@15978 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit af00f29ecb7647e455d3207a4af1c587d7d53e2f 1 parent 576606a
Russell Keith-Magee authored April 02, 2011
22  django/core/context_processors.py
@@ -11,24 +11,6 @@
11 11
 from django.middleware.csrf import get_token
12 12
 from django.utils.functional import lazy
13 13
 
14  
-def auth(request):
15  
-    """
16  
-    DEPRECATED. This context processor is the old location, and has been moved
17  
-    to `django.contrib.auth.context_processors`.
18  
-
19  
-    This function still exists for backwards-compatibility; it will be removed
20  
-    in Django 1.4.
21  
-    """
22  
-    import warnings
23  
-    warnings.warn(
24  
-        "The context processor at `django.core.context_processors.auth` is " \
25  
-        "deprecated; use the path `django.contrib.auth.context_processors.auth` " \
26  
-        "instead.",
27  
-        DeprecationWarning
28  
-    )
29  
-    from django.contrib.auth.context_processors import auth as auth_context_processor
30  
-    return auth_context_processor(request)
31  
-
32 14
 def csrf(request):
33 15
     """
34 16
     Context processor that provides a CSRF token, or the string 'NOTPROVIDED' if
@@ -97,7 +79,7 @@ def __init__(self, *args, **kwargs):
97 79
             "`django.core.context_processors.PermLookupDict` is " \
98 80
             "deprecated; use `django.contrib.auth.context_processors.PermLookupDict` " \
99 81
             "instead.",
100  
-            PendingDeprecationWarning
  82
+            DeprecationWarning
101 83
         )
102 84
         super(PermLookupDict, self).__init__(*args, **kwargs)
103 85
 
@@ -108,6 +90,6 @@ def __init__(self, *args, **kwargs):
108 90
             "`django.core.context_processors.PermWrapper` is " \
109 91
             "deprecated; use `django.contrib.auth.context_processors.PermWrapper` " \
110 92
             "instead.",
111  
-            PendingDeprecationWarning
  93
+            DeprecationWarning
112 94
         )
113 95
         super(PermWrapper, self).__init__(*args, **kwargs)
2  django/core/handlers/modpython.py
@@ -160,7 +160,7 @@ class ModPythonHandler(BaseHandler):
160 160
 
161 161
     def __call__(self, req):
162 162
         warn(('The mod_python handler is deprecated; use a WSGI or FastCGI server instead.'),
163  
-             PendingDeprecationWarning)
  163
+             DeprecationWarning)
164 164
 
165 165
         # mod_python fakes the environ, and thus doesn't process SetEnv.  This fixes that
166 166
         os.environ.update(req.subprocess_env)
10  django/core/mail/__init__.py
@@ -107,13 +107,3 @@ def mail_managers(subject, message, fail_silently=False, connection=None,
107 107
     if html_message:
108 108
         mail.attach_alternative(html_message, 'text/html')
109 109
     mail.send(fail_silently=fail_silently)
110  
-
111  
-
112  
-class SMTPConnection(_SMTPConnection):
113  
-    def __init__(self, *args, **kwds):
114  
-        import warnings
115  
-        warnings.warn(
116  
-            'mail.SMTPConnection is deprecated; use mail.get_connection() instead.',
117  
-            DeprecationWarning
118  
-        )
119  
-        super(SMTPConnection, self).__init__(*args, **kwds)
2  django/core/management/commands/reset.py
@@ -24,7 +24,7 @@ def handle_app(self, app, **options):
24 24
         import warnings
25 25
         warnings.warn(
26 26
             'This command has been deprecated. The command ``flush`` can be used to delete everything. You can also use ALTER TABLE or DROP TABLE statements manually.',
27  
-            PendingDeprecationWarning
  27
+            DeprecationWarning
28 28
         )
29 29
         using = options.get('database', DEFAULT_DB_ALIAS)
30 30
         connection = connections[using]
14  django/core/management/commands/test.py
@@ -23,18 +23,8 @@ def handle(self, *test_labels, **options):
23 23
         failfast = options.get('failfast', False)
24 24
         TestRunner = get_runner(settings)
25 25
 
26  
-        if hasattr(TestRunner, 'func_name'):
27  
-            # Pre 1.2 test runners were just functions,
28  
-            # and did not support the 'failfast' option.
29  
-            import warnings
30  
-            warnings.warn(
31  
-                'Function-based test runners are deprecated. Test runners should be classes with a run_tests() method.',
32  
-                DeprecationWarning
33  
-            )
34  
-            failures = TestRunner(test_labels, verbosity=verbosity, interactive=interactive)
35  
-        else:
36  
-            test_runner = TestRunner(verbosity=verbosity, interactive=interactive, failfast=failfast)
37  
-            failures = test_runner.run_tests(test_labels)
  26
+        test_runner = TestRunner(verbosity=verbosity, interactive=interactive, failfast=failfast)
  27
+        failures = test_runner.run_tests(test_labels)
38 28
 
39 29
         if failures:
40 30
             sys.exit(bool(failures))
2  django/core/management/sql.py
@@ -102,7 +102,7 @@ def sql_reset(app, style, connection):
102 102
     import warnings
103 103
     warnings.warn(
104 104
         'This command has been deprecated. The command ``sqlflush`` can be used to delete everything. You can also use ALTER TABLE or DROP TABLE statements manually.',
105  
-        PendingDeprecationWarning
  105
+        DeprecationWarning
106 106
     )
107 107
     return sql_delete(app, style, connection) + sql_all(app, style, connection)
108 108
 

0 notes on commit af00f29

Please sign in to comment.
Something went wrong with that request. Please try again.