ziggurat_foundations icon indicating copy to clipboard operation
ziggurat_foundations copied to clipboard

Problem using Pylons/webtest

Open fmigneault opened this issue 5 years ago • 4 comments

I'm trying to use Pylons/webtest for validation of my app.

In normal conditions, using ziggurat_foundations.ext.pyramid.sign_in with ziggurat_foundations.sign_in.sign_in_pattern = /signin_internal in my config, I can successfully route the app url using ziggurat.routes.sign_in. Login works as intended.

When using the same procedure with webtest.TestApp, the /signin_internal route returns an 500 response caused by HTTPConnectionPool with max retries exceeded, like if the path didn't exist.

Integration between pyramid and ziggurat seems to be very advanced and solid, so I'm wondering what could be the source of this problem? Any leads or suggestions where to investigate for error causes?

fmigneault avatar Oct 22 '18 19:10 fmigneault

Hm,

Can you provide a minimal test for that that would be failing for you? We could investigate together then.

ergo avatar Oct 22 '18 19:10 ergo

The repo is here : https://github.com/Ouranosinc/Magpie The signin procedure is here: https://github.com/Ouranosinc/Magpie/blob/master/magpie/api/login/login.py#L45-L70

The signin fails here during setup for the following tests that require to be logged in : https://github.com/Ouranosinc/Magpie/blob/master/tests/test_magpie_api.py#L77-L81

Route /signin is called properly, but when it tries to call /signin_internal to run the normal ziggurat login, it cannot find the route somehow. The same tests with a reference to an already running server with the app causes no problem and the tests succeed.

fmigneault avatar Oct 22 '18 22:10 fmigneault

Hey @fmigneault sorry that I did not reply earlier, I was very busy. I will try to find some time to look at this in upcoming days.

ergo avatar Oct 29 '18 22:10 ergo

@ergo Thanks. No problem about the delay, I was also away recently.

fmigneault avatar Nov 12 '18 02:11 fmigneault