mirror of
https://github.com/django/django.git
synced 2025-10-31 09:41:08 +00:00
Fixed #23682 -- Enhanced circular redirects detection in tests.
When the test client detects a redirect to a URL seen in the currently followed chain it will now raise a RedirectCycleError instead of just returning the first repeated response. It will also complain when a single chain of redirects is longer than 20, as this often means a redirect loop with varying URLs, and even if it's not actually one, such long chains are likely to be treated as loops by browsers. Thanks Preston Timmons, Berker Peksag, and Tim Graham for reviews.
This commit is contained in:
@@ -799,6 +799,10 @@ Miscellaneous
|
||||
when both the ``fields`` and ``form_class`` attributes are specified.
|
||||
Previously, ``fields`` was silently ignored.
|
||||
|
||||
* When following redirects, the test client now raises
|
||||
:exc:`~django.test.client.RedirectCycleError` if it detects a loop or hits a
|
||||
maximum redirect limit (rather than passing silently).
|
||||
|
||||
.. _deprecated-features-1.8:
|
||||
|
||||
Features deprecated in 1.8
|
||||
|
||||
Reference in New Issue
Block a user