Hi guys,

I would like to sure my new *open source* project which might be helpful 
for some of you.

The *drf-api-action* <https://github.com/Ori-Roza/drf-api-action> Python 
package is designed to elevate your *testing experience* for *Django Rest 
Framework* (DRF) REST endpoints. With the custom decorator api-action, this 
package empowers you to effortlessly test your REST endpoints as if they 
were conventional functions.

*Features*:

*Simplified Testing*: Easily test DRF REST endpoints using the api-action 
decorator, treating them like regular functions.

*Seamless Integration*: Replace DRF's action decorator with api-action in 
your WebViewSet for a smooth transition.

for example:

class DummyView(APIRestMixin, ModelViewSet):
    queryset = DummyModel.objects.all()
    serializer_class = DummySerializer

    @action_api(detail=True, methods=["get"], 
serializer_class=DummySerializer)
    def dummy(self, request, **kwargs):
        serializer = self.get_serializer(instance=self.get_object())
        return Response(data=serializer.data, status=status.HTTP_200_OK)

def test_dummy():
    api = DummyView()
    result = api.dummy(pk=1)
    assert result['dummy_int'] == 1

Hope you will find it helpful,  and be more than happy to invite you to use 
this package let me know what you think


Thank you for being such a great community!

Ori


-- 
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-framework+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-rest-framework/231de3a8-f19d-4482-be6a-c802b36ba0dfn%40googlegroups.com.

Reply via email to