Index: django/test/testcases.py
===================================================================
--- django/test/testcases.py	(revision 7958)
+++ django/test/testcases.py	(working copy)
@@ -58,6 +58,8 @@
               named fixtures.
             * If the Test Case class has a 'urls' member, replace the
               ROOT_URLCONF with it.
+            * If the Test Case class has a 'templates` member, replace the
+              TEMPLATE_DIRS with it, and include the test template loader.
             * Clearing the mail test outbox.
         """
         call_command('flush', verbosity=0, interactive=False)
@@ -69,6 +71,11 @@
             self._old_root_urlconf = settings.ROOT_URLCONF
             settings.ROOT_URLCONF = self.urls
             clear_url_caches()
+        if hasattr(self, 'templates'):
+            self._old_template_loaders = settings.TEMPLATE_LOADERS
+            self._old_template_dirs = settings.TEMPLATE_DIRS
+            settings.TEMPLATE_LOADERS = ('django.test.template_loader.load_template_source',) + settings.TEMPLATE_LOADERS
+            settings.TEMPLATE_DIRS = self.templates
         mail.outbox = []
 
     def __call__(self, result=None):
@@ -104,6 +111,9 @@
         if hasattr(self, '_old_root_urlconf'):
             settings.ROOT_URLCONF = self._old_root_urlconf
             clear_url_caches()
+        if hasattr(self, '_old_template_loaders'):
+            settings.TEMPLATE_LOADERS = self._old_template_loaders
+            settings.TEMPLATE_DIRS = self._old_template_dirs
 
     def assertRedirects(self, response, expected_url, status_code=302,
                         target_status_code=200, host=None):
Index: django/test/template_loader.py
===================================================================
--- django/test/template_loader.py	(revision 0)
+++ django/test/template_loader.py	(revision 0)
@@ -0,0 +1,18 @@
+from django.conf import settings
+from django.template import TemplateDoesNotExist
+
+def get_template_sources(template_name, template_dirs=None):
+    # We don't use template_dirs as a list of directories.  Instead,
+    # template_dirs is a dictionary with the template_name as the key and
+    # the contents of the template as the value.
+    if not template_dirs:
+        template_dirs = settings.TEMPLATE_DIRS
+    return template_dirs
+
+def load_template_source(template_name, template_dirs=None):
+    template_dirs = get_template_sources(template_name, template_dirs)
+    if template_name in template_dirs:
+        return (template_dirs[template_name], template_name)
+    else:
+        raise TemplateDoesNotExist, template_name
+load_template_source.is_usable = True
Index: django/contrib/auth/tests.py
===================================================================
--- django/contrib/auth/tests.py	(revision 7958)
+++ django/contrib/auth/tests.py	(working copy)
@@ -60,6 +60,11 @@
 class PasswordResetTest(TestCase):
     fixtures = ['authtestdata.json']
     urls = 'django.contrib.auth.urls'
+    templates = {
+        'registration/password_reset_form.html': '{% if form.email.errors %}{{ form.email.html_error_list }}{% endif %}',
+        'registration/password_reset_email.html': '',
+    }
+
     def test_email_not_found(self):
         "Error is raised if the provided email address isn't currently registered"
         response = self.client.get('/password_reset/')
