'An assertion is raised if the formsets non-field errors doesn\'t contain the provided error.'

def test_unknown_nonfield_error(self):

    for (prefix, kwargs) in self.msg_prefixes:
        msg = (prefix + "The    formset    'my_formset',    form    0    in    context    0    does    not    contain    the    non-field    error    'Some    error.'    (actual    errors:    ['Non-field    error.'])")
        with self.assertRaisesMessage(AssertionError, msg):
            self.assertFormsetError(self.response_form_errors, 'my_formset', 0, None, 'Some    error.', **kwargs)
