Hi. I'm trying to find a way to unit test an error code using a django formset. https://docs.djangoproject.com/en/1.11/topics/forms/formsets/#formset-validation I'm raising an error on the form with add error self.add_error(
'name',
forms.ValidationError(
"The name is required",
code=self.NAME_REQUIRED
)
) In my unit test formset.errors returns {'name': ['The name is required']} Is there a way to get at the error code I'm setting in the ValidationError?