[Fixed]-Django REST Testing: Attribute Missing

1👍

force_authenticate() takes a user object for the user arguement, not the string of the username.

So in your case you’d use

self.client.force_authenticate(user=self.admin)

Leave a comment