If the data modifications do not depend on other fields (so the changes are applied to a single field based only on that field), you may just want to do the changes in the 'validate_fieldname' method. You would just return the modified data from it, and it will work with any incoming data type. This only works if the original data can pass the initial validation though.
Note that the reason why you are seeing this issue in tests and not when using postman is because tests send the input as form data, while postman is likely sending it as JSON. Form data is converted into an immutable QueryDict, while JSON data is a standard mutable dictionary.
--
You received this message because you are subscribed to the Google Groups "Django REST framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-rest-fram...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To unsubscribe from this group and stop receiving emails from it, send an email to django-rest-framework+unsub...@googlegroups.com.