mirror of
https://github.com/django/django.git
synced 2025-10-24 14:16:09 +00:00
Fixed #21587 -- Added a warning for changing default of RedirectView.permanent.
This commit is contained in:
committed by
Tim Graham
parent
d43dd03ca3
commit
9a30acad8a
@@ -18,7 +18,7 @@ from django.http import HttpRequest, HttpResponseRedirect, HttpResponsePermanent
|
||||
from django.shortcuts import redirect
|
||||
from django.test import TestCase, override_settings
|
||||
from django.utils import six
|
||||
from django.utils.deprecation import RemovedInDjango20Warning
|
||||
from django.utils.deprecation import RemovedInDjango19Warning, RemovedInDjango20Warning
|
||||
|
||||
from admin_scripts.tests import AdminScriptTestCase
|
||||
|
||||
@@ -309,8 +309,10 @@ class ResolverTests(unittest.TestCase):
|
||||
class ReverseLazyTest(TestCase):
|
||||
|
||||
def test_redirect_with_lazy_reverse(self):
|
||||
response = self.client.get('/redirect/')
|
||||
self.assertRedirects(response, "/redirected_to/", status_code=301)
|
||||
with warnings.catch_warnings():
|
||||
warnings.simplefilter("ignore", RemovedInDjango19Warning)
|
||||
response = self.client.get('/redirect/')
|
||||
self.assertRedirects(response, "/redirected_to/", status_code=301)
|
||||
|
||||
def test_user_permission_with_lazy_reverse(self):
|
||||
User.objects.create_user('alfred', 'alfred@example.com', password='testpw')
|
||||
|
||||
Reference in New Issue
Block a user