<div dir="ltr"><a href="https://bitbucket.org/_amol_/kallithea-tg/src/8ada6ec6c4d3f3c518b4f67b56a20c6efb46971c/kallithea/lib/auth.py?at=default&fileviewer=file-view-default#auth.py-759:760">https://bitbucket.org/_amol_/kallithea-tg/src/8ada6ec6c4d3f3c518b4f67b56a20c6efb46971c/kallithea/lib/auth.py?at=default&fileviewer=file-view-default#auth.py-759:760</a><div><br></div><div>As tgext.routes actually updates environ['REQUEST_METHOD'] I suppose that from that time on request.method will also return DELETE which is not included in that list.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Apr 6, 2016 at 10:19 PM, Thomas De Schampheleire <span dir="ltr"><<a href="mailto:patrickdepinguin@gmail.com" target="_blank">patrickdepinguin@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"> Hi Alessandro,<br>
<span class=""><br>
On Wed, Apr 6, 2016 at 1:30 AM, Alessandro Molina<br>
<<a href="mailto:alessandro.molina@gmail.com">alessandro.molina@gmail.com</a>> wrote:<br>
> Hi Thomas,<br>
><br>
> Had time to give it a quick look.<br>
> Issue was caused by the fact that form was relying on ?_method parameter to<br>
> override request method.<br>
><br>
> It's now supported in tgext.routes 0.1.2<br>
> Just upgrade tgext.routes and it should work ( please raise dependency to<br>
> kallithea-tg, I cannot commit right now :( )<br>
<br>
</span>Thanks, I verified that the mentioned test scenario now works and<br>
pushed the bump to 0.1.2.<br>
<br>
When I retry the failing tests from the test suite, I see that the 404<br>
is indeed gone, but one of the two failing tests still fails.<br>
Originally, with tgext.routes 0.1.1, following tests failed with 404:<br>
<br>
FAIL kallithea/tests/functional/test_admin_defaults.py::TestDefaultsController::()::test_update_browser_fakeout<br>
FAIL kallithea/tests/functional/test_admin_defaults.py::TestDefaultsController::()::test_delete_browser_fakeout<br>
<br>
With tgext.routes 0.1.2, only the delete test fails, as follows:<br>
<br>
――――――――――――――――――――――――――――――――――――――――――――――――――――――――――<br>
TestDefaultsController.test_delete_browser_fakeout<br>
――――――――――――――――――――――――――――――――――――――――――――――――――――――――――<br>
kallithea/tests/functional/test_admin_defaults.py:70: in<br>
test_delete_browser_fakeout<br>
response = self.app.post(url('default', id=1),<br>
params=dict(_method='delete',<br>
_authentication_token=self.authentication_token()))<br>
../venv/kallithea-tg/lib/python2.7/site-packages/webtest/app.py:371: in post<br>
content_type=content_type)<br>
../venv/kallithea-tg/lib/python2.7/site-packages/webtest/app.py:736:<br>
in _gen_request<br>
expect_errors=expect_errors)<br>
../venv/kallithea-tg/lib/python2.7/site-packages/webtest/app.py:632:<br>
in do_request<br>
self._check_status(status, res)<br>
../venv/kallithea-tg/lib/python2.7/site-packages/webtest/app.py:664:<br>
in _check_status<br>
res)<br>
E AppError: Bad response: 405 Method Not Allowed (not 200 OK or 3xx<br>
redirect for <a href="http://localhost/_admin/defaults/1" rel="noreferrer" target="_blank">http://localhost/_admin/defaults/1</a>)<br>
E 405 Method Not Allowed<br>
E<br>
E The method DELETE is not allowed for this resource.<br>
<br>
I looked at your changes in tgext.routes but it does not look a<br>
problem introduced by these changes; maybe it's a latent problem that<br>
now pops up with the 404 fixed.<br>
Is it tg / tgext.routes that generates the 405? How can such a problem<br>
be debugged efficiently?<br>
<br>
Thanks,<br>
Thomas<br>
</blockquote></div><br></div>