Coming from a non python/django background (my experience is groovy/
grails), but when we test our controllers (I think this is equivalent
to django views). We simply set up mock params on the request and set
expectations on the controller properties.
Simple example:
given:
request.params = [ param1: 'valid', param2: 'invalid' ]
when:
controller.submit() // the method called when the webform is
posted
then:
controller.hasErrors == true
and:
controller.param2.error == 'this is invalid'
The above example is obviously simplified, but hopefully it shows the
general idea.