Django’s self.client.login(…) does not work in unit tests

The code that doesn’t work: from django.contrib.auth.models import User from django.test import Client user = User.objects.create(username=”testuser”, password=’12345′) c = Client() logged_in = c.login(username=”testuser”, password=’12345′) Why doesn’t it work? In the snippet above, when the User is created the actual password hash is set to be 12345. When the client calls the login method, the value … Read more