unit testing - What are the advantage of using RequestsClient() over APIClient()? -


i writing unittest django-rest-framework api endpoints. in version 3.5, have added requestsclient(). documentation says -

rather sending http requests network, interface coerce outgoing requests wsgi, , call application directly.

from understanding, think requestsclient() useful network request different servers. not sure if has advantage in same server? there advantage of using requestsclient() on apiclient() ?

if you're not sure, use standard apiclient.

requestsclient useful if either:

  1. you intend interacting api python service , want tests work @ same level.
  2. you want write tests in way allows run them against live or staging environment.

Comments

Popular posts from this blog

How to get the arclen between two curve points in Maya? -

C++ Linked List -

git svn - Unignore directories in git-svn (adding directories to a sparse checkout) -