Deprecated legacy ways of calling cache_page

git-svn-id: http://code.djangoproject.com/svn/django/trunk@16338 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Luke Plant 2011-06-08 11:12:01 +00:00
parent b67ff14208
commit bb12a02bd8
5 changed files with 44 additions and 4 deletions

View file

@ -1,8 +1,10 @@
from functools import wraps
import warnings
from django.contrib.auth.decorators import login_required, permission_required, user_passes_test
from django.contrib.admin.views.decorators import staff_member_required
from django.http import HttpResponse, HttpRequest, HttpResponseNotAllowed
from django.test.utils import get_warnings_state, restore_warnings_state
from django.utils.decorators import method_decorator
from django.utils.functional import allow_lazy, lazy, memoize
from django.utils.unittest import TestCase
@ -65,6 +67,14 @@ fully_decorated = full_decorator(fully_decorated)
class DecoratorsTest(TestCase):
def setUp(self):
self.warning_state = get_warnings_state()
warnings.filterwarnings('ignore', category=PendingDeprecationWarning,
module='django.views.decorators.cache')
def tearDown(self):
restore_warnings_state(self.warning_state)
def test_attributes(self):
"""
Tests that django decorators set certain attributes of the wrapped