Re: following 302s in WebTest form.submit() (was Best practices for writing functional tests to exercise forms?

2015-11-13 Thread Tim Chase
On 2015-11-13 10:22, Carl Meyer wrote: > As far as I know, you have to call `.follow()` on the response, > which follows the redirect and returns the next response. Is that > what you mean by "manually follow every redirect"? It's manual in a > sense, but there is a convenience method to make it ve

Re: following 302s in WebTest form.submit() (was Best practices for writing functional tests to exercise forms?

2015-11-13 Thread Carl Meyer
Hi Tim, On 11/13/2015 10:06 AM, Tim Chase wrote: > On 2015-11-09 12:41, Tim Chase wrote: >> On 2015-11-06 01:09, Carl Meyer wrote: >>> [1] https://pypi.python.org/pypi/WebTest >>> [2] https://pypi.python.org/pypi/django-webtest >> >> Just to follow up, django-webtest has been pretty much exactly w

Re: following 302s in WebTest form.submit() (was Best practices for writing functional tests to exercise forms?

2015-11-13 Thread Tim Chase
On 2015-11-09 12:41, Tim Chase wrote: > On 2015-11-06 01:09, Carl Meyer wrote: > > [1] https://pypi.python.org/pypi/WebTest > > [2] https://pypi.python.org/pypi/django-webtest > > Just to follow up, django-webtest has been pretty much exactly what > I was looking for. Thanks! Monkeying around wi

Re: Best practices for writing functional tests to exercise forms?

2015-11-09 Thread Tim Chase
On 2015-11-06 01:09, Carl Meyer wrote: > [1] https://pypi.python.org/pypi/WebTest > [2] https://pypi.python.org/pypi/django-webtest Just to follow up, django-webtest has been pretty much exactly what I was looking for. Thanks! -Tim -- You received this message because you are subscribed to t

Re: Best practices for writing functional tests to exercise forms?

2015-11-08 Thread Tim Chase
On 2015-11-06 01:09, Carl Meyer wrote: > I recommend the WebTest package [1], along with django-webtest [2] > to adapt it for use with Django. > > [1] https://pypi.python.org/pypi/WebTest > [2] https://pypi.python.org/pypi/django-webtest Thanks for your suggestions, Carl. I'll check them out as

Re: Best practices for writing functional tests to exercise forms?

2015-11-05 Thread Carl Meyer
Hi Tim, On 11/04/2015 05:36 PM, Tim Chase wrote: > Beginning a new project, I'd like to include functional testing in > addition to my unit tests. What are recommended best practices for > exercising form-classes? I was hoping to do something like > > c = django.test.Client() > results = c.

Re: Best practices for writing functional tests to exercise forms?

2015-11-04 Thread Tim Chase
On 2015-11-04 18:39, Gergely Polonkai wrote: > An even more fine grained solution may be using an HTML parser like > beautifulsoup. However, if your site's functionality depends on > client side features like JavaScript, Selenium may be a better > alternative. My code doesn't rely on any JavaScri

Re: Best practices for writing functional tests to exercise forms?

2015-11-04 Thread Gergely Polonkai
An even more fine grained solution may be using an HTML parser like beautifulsoup. However, if your site's functionality depends on client side features like JavaScript, Selenium may be a better alternative. On 4 Nov 2015 18:33, "Dheerendra Rathor" wrote: > You can use unittest.TestCase.assertReg

Re: Best practices for writing functional tests to exercise forms?

2015-11-04 Thread Dheerendra Rathor
You can use unittest.TestCase.assertRegexpMatches for checking if form is present in rendered template. If you want to check the entire cycle (form loading, filling) you can use selenium for testing on live server. On Wed, 4 Nov 2015 at 22:08 Tim Chase wrote: > Beginning a new project, I'd like

Best practices for writing functional tests to exercise forms?

2015-11-04 Thread Tim Chase
Beginning a new project, I'd like to include functional testing in addition to my unit tests. What are recommended best practices for exercising form-classes? I was hoping to do something like c = django.test.Client() results = c.get(page_url) frm = SomeForm() # pseudo-code for desired f