3👍
✅
It doesn’t look like you are creating your user with a password. Without providing a password it is considered a user that cannot be logged in. Providing a password to create_user
should fix it
self.client = Client()
self.user = User.objects.create_user('test_user', password='test_user')
self.client.login(username='test_user', password='test_user')
Source:stackexchange.com