'If a user does not have object permissions on an action, then any
metadata associated with it should not be included in OPTION responses.'

def test_object_permissions(self):

    class ExampleSerializer(serializers.Serializer, ):
        choice_field = serializers.ChoiceField([u'red', u'green', u'blue'])
        integer_field = serializers.IntegerField(max_value=10)
        char_field = serializers.CharField(required=False)
    class ExampleView(views.APIView, ):
        u'Example    view.'
        def post(self, request):
            pass
        def put(self, request):
            pass
        def get_serializer(self):
            return ExampleSerializer()
        def get_object(self):
            if (self.request.method == u'PUT'):
                raise exceptions.PermissionDenied()
    view = ExampleView.as_view()
    response = view(request=request)
    assert (response.status_code == status.HTTP_200_OK)
    assert (list(response.data[u'actions'].keys()) == [u'POST'])
