summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorTim Graham <timograham@gmail.com>2014-11-24 08:36:10 -0500
committerTim Graham <timograham@gmail.com>2015-01-17 07:55:32 -0500
commit61ad1ea92b1f4df992b0ef1dcc7c781da2413815 (patch)
tree31055271da9c5d45e1befbec6d06bfbeda95c4e8 /tests
parent9ce36512fa925231b0496cc10f7d114c069c7c06 (diff)
Removed django.utils.functional.memoize per deprecation timeline.
refs #21351.
Diffstat (limited to 'tests')
-rw-r--r--tests/decorators/tests.py8
-rw-r--r--tests/deprecation/tests.py15
2 files changed, 1 insertions, 22 deletions
diff --git a/tests/decorators/tests.py b/tests/decorators/tests.py
index 467901eebf..30423e7c80 100644
--- a/tests/decorators/tests.py
+++ b/tests/decorators/tests.py
@@ -1,13 +1,12 @@
from functools import wraps, update_wrapper
from unittest import TestCase
-import warnings
from django.contrib.admin.views.decorators import staff_member_required
from django.contrib.auth.decorators import login_required, permission_required, user_passes_test
from django.http import HttpResponse, HttpRequest, HttpResponseNotAllowed
from django.middleware.clickjacking import XFrameOptionsMiddleware
from django.utils.decorators import method_decorator
-from django.utils.functional import allow_lazy, lazy, memoize
+from django.utils.functional import allow_lazy, lazy
from django.views.decorators.cache import cache_page, never_cache, cache_control
from django.views.decorators.clickjacking import xframe_options_deny, xframe_options_sameorigin, xframe_options_exempt
from django.views.decorators.http import require_http_methods, require_GET, require_POST, require_safe, condition
@@ -63,11 +62,6 @@ full_decorator = compose(
lazy,
)
-# suppress the deprecation warning of memoize
-with warnings.catch_warnings():
- warnings.filterwarnings('ignore')
- fully_decorated = memoize(fully_decorated, {}, 1)
-
fully_decorated = full_decorator(fully_decorated)
diff --git a/tests/deprecation/tests.py b/tests/deprecation/tests.py
index 5cf06f0fdf..cae03a8424 100644
--- a/tests/deprecation/tests.py
+++ b/tests/deprecation/tests.py
@@ -9,7 +9,6 @@ from django.test.utils import reset_warning_registry
from django.utils import six, translation
from django.utils.deprecation import RenameMethodsBase
from django.utils.encoding import force_text
-from django.utils.functional import memoize
class RenameManagerMethods(RenameMethodsBase):
@@ -214,20 +213,6 @@ class DeprecatedChineseLanguageCodes(SimpleTestCase):
])
-class DeprecatingMemoizeTest(SimpleTestCase):
- def test_deprecated_memoize(self):
- """
- Ensure the correct warning is raised when memoize is used.
- """
- with warnings.catch_warnings(record=True) as recorded:
- warnings.simplefilter('always')
- memoize(lambda x: x, {}, 1)
- msg = str(recorded.pop().message)
- self.assertEqual(msg,
- 'memoize wrapper is deprecated and will be removed in Django '
- '1.9. Use django.utils.lru_cache instead.')
-
-
class DeprecatingSimpleTestCaseUrls(unittest.TestCase):
def test_deprecation(self):