Index: django/django/contrib/comments/tests/__init__.py
===================================================================
--- django/django/contrib/comments/tests/__init__.py	(revision 0)
+++ django/django/contrib/comments/tests/__init__.py	(working copy)
@@ -4,7 +4,7 @@
 from django.contrib.contenttypes.models import ContentType
 from django.contrib.sites.models import Site
 from django.test import TestCase
-from regressiontests.comment_tests.models import Article, Author
+from django.contrib.comments.tests.test_comments.models import Article, Author
 
 # Shortcut
 CT = ContentType.objects.get_for_model
@@ -13,6 +13,15 @@
 class CommentTestCase(TestCase):
     fixtures = ["comment_tests"]
     urls = 'django.contrib.comments.urls'
+    installed_apps = (
+            'django.contrib.sessions',
+            'django.contrib.sites',
+            'django.contrib.admin',
+            'django.contrib.auth',
+            'django.contrib.comments',
+            'django.contrib.contenttypes',
+            'django.contrib.comments.tests.test_comments'
+        )
 
     def createSomeComments(self):
         # Two anonymous comments on two different objects
@@ -80,9 +89,9 @@
         d.update(f.initial)
         return d
 
-from regressiontests.comment_tests.tests.app_api_tests import *
-from regressiontests.comment_tests.tests.model_tests import *
-from regressiontests.comment_tests.tests.comment_form_tests import *
-from regressiontests.comment_tests.tests.templatetag_tests import *
-from regressiontests.comment_tests.tests.comment_view_tests import *
-from regressiontests.comment_tests.tests.moderation_view_tests import *
+from django.contrib.comments.tests.app_api_tests import *
+from django.contrib.comments.tests.model_tests import *
+from django.contrib.comments.tests.comment_form_tests import *
+from django.contrib.comments.tests.templatetag_tests import *
+from django.contrib.comments.tests.comment_view_tests import *
+from django.contrib.comments.tests.moderation_view_tests import *
Index: django/django/contrib/comments/tests/app_api_tests.py
===================================================================
--- django/django/contrib/comments/tests/app_api_tests.py	(revision 0)
+++ django/django/contrib/comments/tests/app_api_tests.py	(working copy)
@@ -2,7 +2,7 @@
 from django.contrib import comments
 from django.contrib.comments.models import Comment
 from django.contrib.comments.forms import CommentForm
-from regressiontests.comment_tests.tests import CommentTestCase
+from django.contrib.comments.tests import CommentTestCase
 
 class CommentAppAPITests(CommentTestCase):
     """Tests for the "comment app" API"""
Index: django/django/contrib/comments/tests/comment_form_tests.py
===================================================================
--- django/django/contrib/comments/tests/comment_form_tests.py	(revision 0)
+++ django/django/contrib/comments/tests/comment_form_tests.py	(working copy)
@@ -2,8 +2,8 @@
 from django.conf import settings
 from django.contrib.comments.models import Comment
 from django.contrib.comments.forms import CommentForm
-from regressiontests.comment_tests.models import Article
-from regressiontests.comment_tests.tests import CommentTestCase
+from django.contrib.comments.tests.test_comments.models import Article
+from django.contrib.comments.tests import CommentTestCase
 
 class CommentFormTests(CommentTestCase):
 
Index: django/django/contrib/comments/tests/comment_view_tests.py
===================================================================
--- django/django/contrib/comments/tests/comment_view_tests.py	(revision 0)
+++ django/django/contrib/comments/tests/comment_view_tests.py	(working copy)
@@ -2,8 +2,8 @@
 from django.contrib.auth.models import User
 from django.contrib.comments import signals
 from django.contrib.comments.models import Comment
-from regressiontests.comment_tests.models import Article
-from regressiontests.comment_tests.tests import CommentTestCase
+from django.contrib.comments.tests.test_comments.models import Article
+from django.contrib.comments.tests import CommentTestCase
 
 class CommentViewTests(CommentTestCase):
 
Index: django/django/contrib/comments/tests/model_tests.py
===================================================================
--- django/django/contrib/comments/tests/model_tests.py	(revision 0)
+++ django/django/contrib/comments/tests/model_tests.py	(working copy)
@@ -1,6 +1,6 @@
 from django.contrib.comments.models import Comment
-from regressiontests.comment_tests.models import Author, Article
-from regressiontests.comment_tests.tests import CommentTestCase
+from django.contrib.comments.tests.test_comments.models import Author, Article
+from django.contrib.comments.tests import CommentTestCase
 
 class CommentModelTests(CommentTestCase):
 
Index: django/django/contrib/comments/tests/moderation_view_tests.py
===================================================================
--- django/django/contrib/comments/tests/moderation_view_tests.py	(revision 0)
+++ django/django/contrib/comments/tests/moderation_view_tests.py	(working copy)
@@ -1,7 +1,7 @@
 from django.contrib.comments.models import Comment, CommentFlag
 from django.contrib.auth.models import User, Permission
 from django.contrib.contenttypes.models import ContentType
-from regressiontests.comment_tests.tests import CommentTestCase
+from django.contrib.comments.tests import CommentTestCase
 from django.contrib.comments import signals
 
 class FlagViewTests(CommentTestCase):
Index: django/django/contrib/comments/tests/templatetag_tests.py
===================================================================
--- django/django/contrib/comments/tests/templatetag_tests.py	(revision 0)
+++ django/django/contrib/comments/tests/templatetag_tests.py	(working copy)
@@ -1,8 +1,8 @@
 from django.contrib.comments.forms import CommentForm
 from django.contrib.comments.models import Comment
 from django.template import Template, Context
-from regressiontests.comment_tests.models import Article, Author
-from regressiontests.comment_tests.tests import CommentTestCase
+from django.contrib.comments.tests.test_comments.models import Article, Author
+from django.contrib.comments.tests import CommentTestCase
 
 class CommentTemplateTagTests(CommentTestCase):
 
@@ -16,7 +16,7 @@
         self.assertEqual(out, "/post/")
 
     def testGetCommentForm(self, tag=None):
-        t = "{% load comments %}" + (tag or "{% get_comment_form for comment_tests.article a.id as form %}")
+        t = "{% load comments %}" + (tag or "{% get_comment_form for test_comments.article a.id as form %}")
         ctx, out = self.render(t, a=Article.objects.get(pk=1))
         self.assertEqual(out, "")
         self.assert_(isinstance(ctx["form"], CommentForm))
@@ -22,7 +22,7 @@
         self.assert_(isinstance(ctx["form"], CommentForm))
 
     def testGetCommentFormFromLiteral(self):
-        self.testGetCommentForm("{% get_comment_form for comment_tests.article 1 as form %}")
+        self.testGetCommentForm("{% get_comment_form for test_comments.article 1 as form %}")
 
     def testGetCommentFormFromObject(self):
         self.testGetCommentForm("{% get_comment_form for a as form %}")
@@ -28,7 +28,7 @@
         self.testGetCommentForm("{% get_comment_form for a as form %}")
 
     def testRenderCommentForm(self, tag=None):
-        t = "{% load comments %}" + (tag or "{% render_comment_form for comment_tests.article a.id %}")
+        t = "{% load comments %}" + (tag or "{% render_comment_form for test_comments.article a.id %}")
         ctx, out = self.render(t, a=Article.objects.get(pk=1))
         self.assert_(out.strip().startswith("<form action="))
         self.assert_(out.strip().endswith("</form>"))
@@ -34,7 +34,7 @@
         self.assert_(out.strip().endswith("</form>"))
 
     def testRenderCommentFormFromLiteral(self):
-        self.testRenderCommentForm("{% render_comment_form for comment_tests.article 1 %}")
+        self.testRenderCommentForm("{% render_comment_form for test_comments.article 1 %}")
 
     def testRenderCommentFormFromObject(self):
         self.testRenderCommentForm("{% render_comment_form for a %}")
@@ -41,7 +41,7 @@
 
     def testGetCommentCount(self, tag=None):
         self.createSomeComments()
-        t = "{% load comments %}" + (tag or "{% get_comment_count for comment_tests.article a.id as cc %}") + "{{ cc }}"
+        t = "{% load comments %}" + (tag or "{% get_comment_count for test_comments.article a.id as cc %}") + "{{ cc }}"
         ctx, out = self.render(t, a=Article.objects.get(pk=1))
         self.assertEqual(out, "2")
 
@@ -46,7 +46,7 @@
         self.assertEqual(out, "2")
 
     def testGetCommentCountFromLiteral(self):
-        self.testGetCommentCount("{% get_comment_count for comment_tests.article 1 as cc %}")
+        self.testGetCommentCount("{% get_comment_count for test_comments.article 1 as cc %}")
 
     def testGetCommentCountFromObject(self):
         self.testGetCommentCount("{% get_comment_count for a as cc %}")
@@ -53,7 +53,7 @@
 
     def testGetCommentList(self, tag=None):
         c1, c2, c3, c4 = self.createSomeComments()
-        t = "{% load comments %}" + (tag or "{% get_comment_list for comment_tests.author a.id as cl %}")
+        t = "{% load comments %}" + (tag or "{% get_comment_list for test_comments.author a.id as cl %}")
         ctx, out = self.render(t, a=Author.objects.get(pk=1))
         self.assertEqual(out, "")
         self.assertEqual(list(ctx["cl"]), [c2])
@@ -59,7 +59,7 @@
         self.assertEqual(list(ctx["cl"]), [c2])
 
     def testGetCommentListFromLiteral(self):
-        self.testGetCommentList("{% get_comment_list for comment_tests.author 1 as cl %}")
+        self.testGetCommentList("{% get_comment_list for test_comments.author 1 as cl %}")
 
     def testGetCommentListFromObject(self):
         self.testGetCommentList("{% get_comment_list for a as cl %}")
Index: django/django/test/testcases.py
===================================================================
--- django/django/test/testcases.py	(revision 9536)
+++ django/django/test/testcases.py	(working copy)
@@ -8,6 +8,7 @@
 from django.core.management import call_command
 from django.core.urlresolvers import clear_url_caches
 from django.db import transaction
+from django.db.models.loading import load_app
 from django.http import QueryDict
 from django.test import _doctest as doctest
 from django.test.client import Client
@@ -173,6 +174,11 @@
     def _pre_setup(self):
         """Performs any pre-test setup. This includes:
 
+            * If the Test Case class has a 'installed_apps' member, replace the
+              INSTALLED_APPS with it.
+            * If the Test Case class has a 'extra_apps' member, append it to
+              INSTALLED_APPS.
+            * Create tables and load models for test apps.
             * Flushing the database.
             * If the Test Case class has a 'fixtures' member, installing the 
               named fixtures.
@@ -180,6 +186,21 @@
               ROOT_URLCONF with it.
             * Clearing the mail test outbox.
         """
+        if hasattr(self, 'installed_apps'):
+            self._old_installed_apps = settings.INSTALLED_APPS
+            settings.INSTALLED_APPS = list(self.installed_apps)
+        if hasattr(self, 'extra_apps'):
+            if hasattr(self, '_old_installed_apps'):
+                # extra_apps and installed_apps can coexist
+                settings.INSTALLED_APPS += list(self.extra_apps)
+            else:
+                self._old_installed_apps = settings.INSTALLED_APPS
+                settings.INSTALLED_APPS += list(self.extra_apps)
+        if hasattr(self, '_old_installed_apps'):
+            for app_label in settings.INSTALLED_APPS:
+                load_app(app_label)
+            # Create the new tables in db
+            call_command('syncdb', verbosity=0, interactive=False)
         call_command('flush', verbosity=0, interactive=False)
         if hasattr(self, 'fixtures'):
             # We have to use this slightly awkward syntax due to the fact
@@ -220,6 +241,8 @@
         """ Performs any post-test things. This includes:
 
             * Putting back the original ROOT_URLCONF if it was changed.
+            * Putting back the original INSTALLED_APPS if it was changed.
+            * Unload models and destroy tables for test apps.
         """
         if hasattr(self, '_old_root_urlconf'):
             settings.ROOT_URLCONF = self._old_root_urlconf
@@ -224,6 +247,9 @@
         if hasattr(self, '_old_root_urlconf'):
             settings.ROOT_URLCONF = self._old_root_urlconf
             clear_url_caches()
+        if hasattr(self, '_old_installed_apps'):
+            settings.INSTALLED_APPS = self._old_installed_apps
+            #TODO: test apps should be unloaded from the app cache, and the extra tables destroyed.
 
     def assertRedirects(self, response, expected_url, status_code=302,
                         target_status_code=200, host=None):
