ericholscher / django-test-utils

Utilities for testing Django applications
http://django-test-utils.readthedocs.org/
MIT License
343 stars 69 forks source link

Submit and cookies #10

Open msgre opened 14 years ago

msgre commented 14 years ago

Hello Eric, I try using twill to my tests but I am unable to successfully submit form via POST as logged user. Look at this code:

login(username="myusername", password="mypassword") go('/myurl/') fv(2, 'continue', '') submit()

problem

logout()

If I print show_cookies() I get different value before and after submit. On this test I want to check, if application return the same page with form together with error messages due to mandatory form fields. But all I get is login page (because POST don't set cookies, and my code put redirection to login page).