summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaap Roes <jaap@eight.nl>2014-10-10 12:40:13 +0200
committerTim Graham <timograham@gmail.com>2014-10-10 09:22:20 -0400
commit115c307184d441fbc27a8f43a99af5d992cfcc13 (patch)
tree33aaeef0e690508e080157f4add6e7af567fe6e3
parent1b5918f160365b97986f21da1a7c35ffd2d5b0b0 (diff)
Fixed #23613 -- Deprecated django.utils.checksums
-rw-r--r--django/utils/checksums.py9
-rw-r--r--docs/internals/deprecation.txt3
-rw-r--r--docs/releases/1.8.txt10
-rw-r--r--tests/utils_tests/test_checksums.py9
4 files changed, 30 insertions, 1 deletions
diff --git a/django/utils/checksums.py b/django/utils/checksums.py
index 01c1e68108..40d6814d52 100644
--- a/django/utils/checksums.py
+++ b/django/utils/checksums.py
@@ -4,7 +4,16 @@ Common checksum routines.
__all__ = ['luhn']
+import warnings
+
from django.utils import six
+from django.utils.deprecation import RemovedInDjango20Warning
+
+warnings.warn(
+ "django.utils.checksums will be removed in Django 2.0. The "
+ "luhn() function is now included in django-localflavor 1.1+.",
+ RemovedInDjango20Warning
+)
LUHN_ODD_LOOKUP = (0, 2, 4, 6, 8, 1, 3, 5, 7, 9) # sum_of_digits(index * 2)
diff --git a/docs/internals/deprecation.txt b/docs/internals/deprecation.txt
index 6085117b93..3a7c17b388 100644
--- a/docs/internals/deprecation.txt
+++ b/docs/internals/deprecation.txt
@@ -59,6 +59,9 @@ about each item can often be found in the release notes of two versions prior.
* ``django.db.models.field.subclassing.SubfieldBase`` will be removed.
+* ``django.utils.checksums`` will be removed; its functionality is included
+ in django-localflavor 1.1+.
+
.. _deprecation-removed-in-1.9:
1.9
diff --git a/docs/releases/1.8.txt b/docs/releases/1.8.txt
index d430a4af45..41907634b2 100644
--- a/docs/releases/1.8.txt
+++ b/docs/releases/1.8.txt
@@ -829,3 +829,13 @@ in ``.values()`` calls or in aggregates. It has been replaced with
:meth:`~django.db.models.Field.from_db_value`. Note that the new approach does
not call the :meth:`~django.db.models.Field.to_python` method on assignment
as was the case with ``SubfieldBase``.
+
+``django.utils.checksums``
+~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+The ``django.utils.checksums`` module has been deprecated and will be removed
+in Django 2.0. The functionality it provided (validating checksum using the
+Luhn algorithm) was undocumented and not used in Django. The module has been
+moved to the `django-localflavor`_ package (version 1.1+).
+
+.. _django-localflavor: https://pypi.python.org/pypi/django-localflavor
diff --git a/tests/utils_tests/test_checksums.py b/tests/utils_tests/test_checksums.py
index 9c9f244b6c..0302956014 100644
--- a/tests/utils_tests/test_checksums.py
+++ b/tests/utils_tests/test_checksums.py
@@ -1,6 +1,13 @@
import unittest
+import warnings
-from django.utils import checksums
+from django.utils.deprecation import RemovedInDjango20Warning
+
+with warnings.catch_warnings():
+ warnings.filterwarnings(
+ 'ignore', 'django.utils.checksums will be removed in Django 2.0.',
+ RemovedInDjango20Warning)
+ from django.utils import checksums
class TestUtilsChecksums(unittest.TestCase):