When the client calls the login method, the value of the password argument, 12345 , is c = Client() logged_in = c.login(username='testuser', password='12345') self.user = User.objects.create(username='admin', password='pass@123', .