﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
26428	Add support for relative path redirects to the test Client	master	nobody	"Consider this definition, in a reusable app:
{{{
url(r'^inbox/$', InboxView.as_view(), name='inbox'),
url(r'^$', RedirectView.as_view(url='inbox/')),
}}}
And
{{{
urlpatterns = [
    url(r'^messages/', include((app_name_patterns, 'app_name'), namespace='app_name')), 
]
}}}
This was working on 1.8, thanks to http.fix_location_header, which converts the url to something like {{{http://testserver/messages/inbox/}}}.

1.9 introduced the ""HTTP redirects no longer forced to absolute URIs"" change and the fix has disappeared, the reason being ""... allows relative URIs in Location, recognizing the actual practice of user agents, almost all of which support them."".
Unfortunately, this is not fully the case of test.Client. It doesn't support relative-path reference - not beginning with a slash character, but only absolute-path reference - beginning with a single slash character ([https://tools.ietf.org/html/rfc3986#section-4.2, ref]). A GET to {{{inbox/}}} leads to 404.

I'm using a workaround with {{{... url=reverse_lazy('app_name:inbox') ...}}}, referred by a TestCase.urls attribute, to produce {{{/messages/inbox/}}}, but I'm not happy with this hardcoded namespace.
"	New feature	closed	Testing framework	1.9	Release blocker	fixed			Accepted	1	0	0	0	0	0
