Fixed #23682 -- Enhanced circular redirects detection in tests.

Please see [#23682](https://code.djangoproject.com/ticket/23682).
This might be more appropriate in "backwards incompatible changes" since tests that fail silently now would break.