| 112 | | "The field '%s' on form '%s' in context %d does not contain the error '%s' (actual errors: %s)" % |
|---|
| 113 | | (field, form, i, err, list(context[form].errors[field]))) |
|---|
| | 112 | "The field '%s' on form '%s' in context %d does not contain the error '%s' (actual errors: %s)" % |
|---|
| | 113 | (field, form, i, err, list(context[form].errors[field]))) |
|---|
| | 114 | elif field in context[form].fields: |
|---|
| | 115 | self.fail("The field '%s' on form '%s' in context %d contains no errors" % |
|---|
| | 116 | (field, form, i)) |
|---|
| 115 | | self.assertTrue(err in context[form].non_field_errors(), |
|---|
| 116 | | "The form '%s' in context %d does not contain the non-field error '%s' (actual errors: %s)" % |
|---|
| 117 | | (form, i, err, list(context[form].non_field_errors()))) |
|---|
| 118 | | except KeyError: |
|---|
| 119 | | self.fail("The form '%s' in context %d does not contain the field '%s'" % (form, i, field)) |
|---|
| | 118 | self.fail("The form '%s' in context %d does not contain the field '%s'" % (form, i, field)) |
|---|
| | 119 | else: |
|---|
| | 120 | self.assertTrue(err in context[form].non_field_errors(), |
|---|
| | 121 | "The form '%s' in context %d does not contain the non-field error '%s' (actual errors: %s)" % |
|---|
| | 122 | (form, i, err, list(context[form].non_field_errors()))) |
|---|