forked from django/django
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed #21587 -- Added a warning for changing default of RedirectView.…
…permanent.
- Loading branch information
1 parent
d43dd03
commit 9a30aca
Showing
7 changed files
with
136 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,7 +18,7 @@ | |
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 @@ def test_404_tried_urls_have_names(self): | |
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', '[email protected]', password='testpw') | ||
|