test_validation.py
8.15 KB
-
Fix nested validation error being rendered incorrectly. · 651319e2
Previously an extra list wrapped nested validation errors raised from serializer's validate() methods. That was inconsistent with the format of validation errors raised by validate_<fieldname> methods. i.e. these two resulted in *different* behaviour: def validate_foo(self): raise ValidationError(['bar']) def validate(self): raise ValidationError({'foo': ['bar']})
Craig de Stigter committed