diff options
| author | Luke Plant <L.Plant.98@cantab.net> | 2011-06-08 11:12:01 +0000 |
|---|---|---|
| committer | Luke Plant <L.Plant.98@cantab.net> | 2011-06-08 11:12:01 +0000 |
| commit | bb12a02bd8cd6e33b947b2cfa01292822099bb19 (patch) | |
| tree | 6d572f1af67e0c8e45038d5b45da839bc0d0e16a /tests | |
| parent | b67ff14208049e90310c4c312036116ee620c295 (diff) | |
Deprecated legacy ways of calling cache_page
git-svn-id: http://code.djangoproject.com/svn/django/trunk@16338 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/regressiontests/decorators/tests.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/regressiontests/decorators/tests.py b/tests/regressiontests/decorators/tests.py index 8a03980f88..f1d1c10975 100644 --- a/tests/regressiontests/decorators/tests.py +++ b/tests/regressiontests/decorators/tests.py @@ -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 |
