[TIP] About patching(mocking) forms in Django tests

David Stanek dstanek at dstanek.com
Sun Mar 24 06:41:43 PDT 2013


I mock out forms when I want to test the view, but I don't want the
validation to be triggered.  I see no need to craft test data that passes
validation when testing the view.  Doing so means that my view test can now
be broken by changing the validation requirements.  This coupling is
usually a bad thing.


On Sun, Mar 24, 2013 at 8:12 AM, andrea crotti <andrea.crotti.0 at gmail.com>wrote:

> Is it really worth to mock the form in this case?
> Why can't you use the real class in this case?
>
> _______________________________________________
> testing-in-python mailing list
> testing-in-python at lists.idyll.org
> http://lists.idyll.org/listinfo/testing-in-python
>
>


-- 
David
blog: http://www.traceback.org
twitter: http://twitter.com/dstanek
www: http://dstanek.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.idyll.org/pipermail/testing-in-python/attachments/20130324/d4b6ca8e/attachment.htm>


More information about the testing-in-python mailing list