tgext.routes changes

Thomas De Schampheleire patrickdepinguin at gmail.com
Wed Apr 6 20:19:18 UTC 2016


 Hi Alessandro,

On Wed, Apr 6, 2016 at 1:30 AM, Alessandro Molina
<alessandro.molina at gmail.com> wrote:
> Hi Thomas,
>
> Had time to give it a quick look.
> Issue was caused by the fact that form was relying on ?_method parameter to
> override request method.
>
> It's now supported in tgext.routes 0.1.2
> Just upgrade tgext.routes and it should work ( please raise dependency to
> kallithea-tg, I cannot commit right now :( )

Thanks, I verified that the mentioned test scenario now works and
pushed the bump to 0.1.2.

When I retry the failing tests from the test suite, I see that the 404
is indeed gone, but one of the two failing tests still fails.
Originally, with tgext.routes 0.1.1, following tests failed with 404:

FAIL kallithea/tests/functional/test_admin_defaults.py::TestDefaultsController::()::test_update_browser_fakeout
FAIL kallithea/tests/functional/test_admin_defaults.py::TestDefaultsController::()::test_delete_browser_fakeout

With tgext.routes 0.1.2, only the delete test fails, as follows:

――――――――――――――――――――――――――――――――――――――――――――――――――――――――――
TestDefaultsController.test_delete_browser_fakeout
――――――――――――――――――――――――――――――――――――――――――――――――――――――――――
kallithea/tests/functional/test_admin_defaults.py:70: in
test_delete_browser_fakeout
    response = self.app.post(url('default', id=1),
params=dict(_method='delete',
_authentication_token=self.authentication_token()))
../venv/kallithea-tg/lib/python2.7/site-packages/webtest/app.py:371: in post
    content_type=content_type)
../venv/kallithea-tg/lib/python2.7/site-packages/webtest/app.py:736:
in _gen_request
    expect_errors=expect_errors)
../venv/kallithea-tg/lib/python2.7/site-packages/webtest/app.py:632:
in do_request
    self._check_status(status, res)
../venv/kallithea-tg/lib/python2.7/site-packages/webtest/app.py:664:
in _check_status
    res)
E   AppError: Bad response: 405 Method Not Allowed (not 200 OK or 3xx
redirect for http://localhost/_admin/defaults/1)
E   405 Method Not Allowed
E
E   The method DELETE is not allowed for this resource.

I looked at your changes in tgext.routes but it does not look a
problem introduced by these changes; maybe it's a latent problem that
now pops up with the 404 fixed.
Is it tg / tgext.routes that generates the 405? How can such a problem
be debugged efficiently?

Thanks,
Thomas


More information about the kallithea-general mailing list