'Asserts that no form in the context has errors.
If you add this check before checking the status code of the response
you\'ll see a more informative error.'

def assertNoFormErrors(self, response):

    if (response.context is None):
        return
    if (len(response.templates) == 1):
        tpl = [response.context]
    else:
        tpl = response.context
    for ctx in tpl:
        for (k, v) in ctx.iteritems():
            if isinstance(v, (forms.BaseForm, forms.formsets.BaseFormSet)):
                if isinstance(v, forms.formsets.BaseFormSet):
                    msg = '\n'.join((f.errors.as_text() for f in v.forms))
                else:
                    msg = v.errors.as_text()
                msg = msg.strip()
                if (msg != ''):
                    self.fail(('form    %r    had    the    following    error(s):\n%s' % (k, msg)))
                if hasattr(v, 'non_field_errors'):
                    self.assertEquals(v.non_field_errors(), [])
                if hasattr(v, 'non_form_errors'):
                    self.assertEquals(v.non_form_errors(), [])
