[Answer]-Creating object for APIClient() causing wiping out all the data in database

1👍

Doesn’t the APITestCase already setup a client?
http://www.django-rest-framework.org/api-guide/testing#test-cases

Also, if you mean existing data from your database isn’t accessible, usually a test case sets up it’s own data. Ideally, one test case should not leave data behind so they usually create a temporary db and truncate that at the end of the test. So in that setUp you should set up any data needed in the test case.

Leave a comment