If you look at the tools and helpers for testing “standard” views in Django you will find something very analogue, the
TestClient and a
The RequestFactory shares the same API as the test client. However,
instead of behaving like a browser, the RequestFactory provides a way
to generate a request instance that can be used as the first argument
to any view. This means you can test a view function the same way as
you would test any other function – as a black box, with exactly known
inputs, testing for specific outputs.
RequestFactory allows you to test you views in a very isolated manner. You can build a request and test your view without the need to setup your urls or care about things happening in middlewares etc.
So this is closer to a typical unit test.
That said, both types of tests are useful. To get a general feeling if your API works as expected I would probably start using the APIClient and use RequestFactories when it comes to more complex views. But the right mix depends a lot on your concrete application.