Hi,
On Tuesday, September 23, 2014 6:54:19 AM UTC+2, Artem B wrote:
>
> Hi , i'm trying use webtest for simple login,
>
> got: AppError: Bad response: 403 FORBIDDEN. CSRF verification failed
>
> could you help me please. Where my mistake ?
>
> class AuthTest(unittest.TestCase):
> def test_login_form(self):
> test_app = TestApp('http://127.0.0.1:8000')
> login_form = test_app.get('/login/').form
> login_form['username'] = 'login'
> login_form['password'] = 'pass'
> response = login_form.submit()
>
> Thanks
>
I remember a bug about about cookies when the host is localhost but it
should be fixed in recent webtest versions.
You can try to use the trick mentioned in the issue:
https://github.com/Pylons/webtest/issues/84
--
You received this message because you are subscribed to the Google Groups
"pylons-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/pylons-discuss.
For more options, visit https://groups.google.com/d/optout.