1👍
Django will set self.client
per default to an instance of django.test.client.Client
.
You should make your client available at a different name eg. cls.api_client = APIClient()
.
Note that if you are setting up data in in setUpClass()
you are also responsible for removing it again in tearDownClass()
, for example remove the user you created as Django will not handle this for you.
Source:stackexchange.com