Test case setUp() that first creates a user and the try's to force authenticate the user but a wired error occurs...
TypeError: force_authenticate() missing 1 required positional argument: 'self'
class PrivateUserApiTest(TestCase):
""" Test API that require authentication """
def setUp(self):
self.user = create_user(
email="[email protected]",
password="testpass",
name="testName"
)
print(self.user)
self.client = APIClient
self.client.force_authenticate(user=self.user) # <--
def force_authenticate(self, user, other, arguments):. - Leon Markes