Code a sample view which uses permissions derived from BaseProblemPermission class and throws a registered exception. Write tests with this view to test the following behaviors:
When the permission passes, content type is "application/json".
When the permission fails, content type is "application/problem+json" and the problem code is the same as the one declared in the registered exception with the permission.
And if I follow those directions I get a error url in the returned JSON ...
... but I don't understand how to take this further. How can I control what the url is for a given situation ? Any further explanation would be appreciated. Thanks.
If there is a serializer data validation error on a field title, status or type, the validation message will be overwritten by drf-problems which forces exception meta info into those fields.