diff options
| author | wrwrwr <git@wr.waw.pl> | 2014-10-17 15:46:42 +0200 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2014-11-25 10:12:28 -0500 |
| commit | 056a3c6c374f15e23746ea8568cd5b11bfe7d442 (patch) | |
| tree | 528710827a03490d2fa4d3d630c5ab31828905a5 /docs | |
| parent | a973fb2d68f2e23e599a601fdaec13d129207e9f (diff) | |
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.
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/ref/exceptions.txt | 14 | ||||
| -rw-r--r-- | docs/releases/1.8.txt | 4 |
2 files changed, 18 insertions, 0 deletions
diff --git a/docs/ref/exceptions.txt b/docs/ref/exceptions.txt index e74e0991e1..bbd0229610 100644 --- a/docs/ref/exceptions.txt +++ b/docs/ref/exceptions.txt @@ -217,6 +217,20 @@ Transaction exceptions are defined in :mod:`django.db.transaction`. The :exc:`TransactionManagementError` is raised for any and all problems related to database transactions. +.. currentmodule:: django.test + +Testing Framework Exceptions +============================ + +Exceptions provided by the :mod:`django.test` package. + +.. exception:: client.RedirectCycleError + + .. versionadded:: 1.8 + + :exc:`~client.RedirectCycleError` is raised when the test client detects a + loop or an overly long chain of redirects. + Python Exceptions ================= diff --git a/docs/releases/1.8.txt b/docs/releases/1.8.txt index ba0b0cfa2b..73ad244cfb 100644 --- a/docs/releases/1.8.txt +++ b/docs/releases/1.8.txt @@ -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 |
