I should add that I was able to simply use a Session() instead of RequestsClient() but then why would I use the RequestsClient() if it's not truly acting like a real browser locally either? The whole point is to emulate and simulate the 'server' environment with network and db latencies. Using session alone seems to be working but I'm not sure why I'd switch to RequestsClient() for local tests either.
On Monday, March 27, 2017 at 5:06:37 AM UTC+4, [email protected] wrote: > > The docs ( > http://www.django-rest-framework.org/api-guide/testing/#live-tests) state > that the RequestsClient makes it possible to run a test case against a live > server, but I can't see any explicit instructions for how to achieve this. > > The RequestsClient mounts a DjangoTestAdapter which just sends the > requests directly to the local wsgi app, and I can't see any way to > override that behaviour. Is the expected way of achieving this just to swap > out the RequestsClient for a normal requests Session if you're in live test > mode? > -- 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 [email protected]. For more options, visit https://groups.google.com/d/optout.
