{{{
AssertionError: 404 != 200 : Couldn't retrieve redirection page '/some-
path/': response code was 404 (expected 200)
}}}
It would be better if `assertRedirects` could detect that it was being
used incorrectly, and gave a more helpful error message.
--
Ticket URL: <https://code.djangoproject.com/ticket/26666>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* needs_better_patch: => 0
* stage: Unreviewed => Accepted
* type: Bug => Cleanup/optimization
* needs_tests: => 0
* needs_docs: => 0
Comment:
The message could suggest using the `fetch_redirect_response=False`
argument.
--
Ticket URL: <https://code.djangoproject.com/ticket/26666#comment:1>
* status: new => assigned
* owner: nobody => tobiasmcnulty
--
Ticket URL: <https://code.djangoproject.com/ticket/26666#comment:2>
* has_patch: 0 => 1
--
Ticket URL: <https://code.djangoproject.com/ticket/26666#comment:3>
* status: assigned => closed
* resolution: => fixed
Comment:
In [changeset:"c7b1b81352533be9b7f4637c12219f59c0964a82" c7b1b81]:
{{{
#!CommitTicketReference repository=""
revision="c7b1b81352533be9b7f4637c12219f59c0964a82"
Fixed #26666 -- Added more useful error message to assertRedirects
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/26666#comment:4>
* status: closed => new
* has_patch: 1 => 0
* version: 1.9 => master
* resolution: fixed =>
Comment:
Tobias is working on fixing the test failures that the patched introduced.
--
Ticket URL: <https://code.djangoproject.com/ticket/26666#comment:5>
Comment (by Markus Holtermann <info@…>):
In [changeset:"78a0ca67f6dfb6c74dcabe36aa460c4eb5cfe7ae" 78a0ca6]:
{{{
#!CommitTicketReference repository=""
revision="78a0ca67f6dfb6c74dcabe36aa460c4eb5cfe7ae"
Refs #26666 -- Fixed test failures caused by assertRedirects changes
(#6701)
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/26666#comment:6>
Comment (by tobiasmcnulty):
* The original fix to this ticket
(https://github.com/django/django/pull/6696) broke unit testing of custom
hostnames in non-core Django projects when the hostname was passed as part
of the path to client.get()
* A new proposed change (https://github.com/django/django/pull/6713)
leverages ALLOWED_HOSTS to facilitate support for custom domain testing in
3rd party packages while increasing the rigor which with we validate
ALLOWED_HOSTS (now also in tests)
--
Ticket URL: <https://code.djangoproject.com/ticket/26666#comment:7>
* has_patch: 0 => 1
Comment:
The code part LGTM but the doc could benefit from a second look of a
native speaker.
--
Ticket URL: <https://code.djangoproject.com/ticket/26666#comment:8>
Comment (by phildini):
As a native speaker I took a look over the docs, and they make a lot of
sense minus one potentially confusing bit. I left a comment on the PR.
--
Ticket URL: <https://code.djangoproject.com/ticket/26666#comment:9>
Comment (by Tim Graham <timograham@…>):
In [changeset:"17e661641ddaf8266e7430d83cfb2039abc55df7" 17e66164]:
{{{
#!CommitTicketReference repository=""
revision="17e661641ddaf8266e7430d83cfb2039abc55df7"
Refs #26666 -- Added ALLOWED_HOSTS validation when running tests.
Also used ALLOWED_HOSTS to check for external hosts in assertRedirects().
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/26666#comment:10>
* status: new => closed
* resolution: => fixed
--
Ticket URL: <https://code.djangoproject.com/ticket/26666#comment:11>