Index: tests/regressiontests/test_client_regress/models.py
===================================================================
--- tests/regressiontests/test_client_regress/models.py	(Revision 6669)
+++ tests/regressiontests/test_client_regress/models.py	(Arbeitskopie)
@@ -261,3 +261,11 @@
         # Check that assertRedirects uses the original client, not the
         # default client.
         self.assertRedirects(response, "http://testserver/test_client_regress/get_view/")
+
+    def test_login_with_user_instance(self):
+        "Check login_user(): Log in without a password."
+        from django.contrib.auth.models import User
+        c = Client()
+        login = c.login_user(User.objects.get(username='testclient'))
+        self.failUnless(login, 'Could not log in')
+
Index: django/test/client.py
===================================================================
--- django/test/client.py	(Revision 6671)
+++ django/test/client.py	(Arbeitskopie)
@@ -3,7 +3,7 @@
 from cStringIO import StringIO
 from urlparse import urlparse
 from django.conf import settings
-from django.contrib.auth import authenticate, login
+from django.contrib.auth import authenticate, login, get_backends
 from django.core.handlers.base import BaseHandler
 from django.core.handlers.wsgi import WSGIRequest
 from django.core.signals import got_request_exception
@@ -245,6 +245,12 @@
         not available.
         """
         user = authenticate(**credentials)
+        return self.login_user(user)
+
+    def login_user(self, user):
+        if user and not hasattr(user, "backend"):
+            backend=get_backends()[0]
+            user.backend = "%s.%s" % (backend.__module__, backend.__class__.__name__)
         if user and user.is_active and 'django.contrib.sessions' in settings.INSTALLED_APPS:
             engine = __import__(settings.SESSION_ENGINE, {}, {}, [''])
 
Index: docs/testing.txt
===================================================================
--- docs/testing.txt	(Revision 6669)
+++ docs/testing.txt	(Arbeitskopie)
@@ -552,6 +552,15 @@
     conditions. You'll need to create users as part of the test suite -- either
     manually (using the Django model API) or with a test fixture.
 
+``login_user(user)``
+    **New in Django development version**
+
+    Like ``login()`` but you can use a user instance (without using a password)::
+
+        >>> c = Client()
+        >>> if c.login_user(User.objects.get(username='admin')):
+        >>>     ...
+
 ``logout()``
     **New in Django development version**
 
