Index: django/test/testcases.py
===================================================================
--- django/test/testcases.py	(revision 12288)
+++ django/test/testcases.py	(working copy)
@@ -1,4 +1,6 @@
 import re
+import sys
+import imp
 import unittest
 from urlparse import urlsplit, urlunsplit
 from xml.dom.minidom import parseString, Node
@@ -13,6 +15,7 @@
 from django.test.client import Client
 from django.utils import simplejson
 from django.utils.encoding import smart_str
+from django.utils.importlib import import_module
 
 try:
     all
@@ -210,6 +213,10 @@
             transaction.rollback_unless_managed(using=conn)
 
 class TransactionTestCase(unittest.TestCase):
+    # This can be modified to bypass what the settings are when running a test.
+    combine_urls = False
+    combine_urls_with = None
+
     def _pre_setup(self):
         """Performs any pre-test setup. This includes:
 
@@ -242,7 +249,42 @@
     def _urlconf_setup(self):
         if hasattr(self, 'urls'):
             self._old_root_urlconf = settings.ROOT_URLCONF
-            settings.ROOT_URLCONF = self.urls
+            if settings.TEST_COMBINE_URLCONFS or self.combine_urls:
+                # Put the module instance of self.urls into specified_urlconf.
+                if not isinstance(self.urls, basestring):
+                    specified_urlconf = self.urls
+                else:
+                    specified_urlconf = import_module(self.urls)
+                # Choose between settings.TEST_COMBINE_URLCONFS_WITH and
+                # settings.ROOT_URLCONF.
+                urls_to_combine = self.combine_urls_with or \
+                    settings.TEST_COMBINE_URLCONFS_WITH or settings.ROOT_URLCONF
+                # Do the above action, this time with urls_to_combine.
+                if not isinstance(urls_to_combine, basestring):
+                    extra_urlconf = urls_to_combine
+                else:
+                    extra_urlconf = import_module(urls_to_combine)
+                # Create a dynamic URLconf module that combines the urlpatterns.
+                # of specified_urlconf and extra_urlconf
+                dynamic_urlconf_name = 'dynamic_urls'
+                dynamic_urlconf = imp.new_module(dynamic_urlconf_name)
+                dynamic_urlconf.urlpatterns = specified_urlconf.urlpatterns + \
+                        extra_urlconf.urlpatterns
+	            # Also combine handler404 and 500, favoring specified_urlconf 
+                handler404 = getattr(specified_urlconf, 'handler404', None) or \
+                    getattr(extra_urlconf, 'handler404', None) 
+                if handler404: 
+                    dynamic_urlconf.handler404 = handler404 
+                handler500 = getattr(specified_urlconf, 'handler500', None) or \
+                    getattr(extra_urlconf, 'handler500', None) 
+                if handler500: 
+                    dynamic_urlconf.handler500 = handler500 
+                # Add our dynamic_urlconf to sys.modules and set 
+                # settings.ROOT_URLCONF to it.
+                sys.modules[dynamic_urlconf_name] = dynamic_urlconf
+                settings.ROOT_URLCONF = dynamic_urlconf
+            else:
+                settings.ROOT_URLCONF = self.urls
             clear_url_caches()
 
     def __call__(self, result=None):
Index: django/conf/global_settings.py
===================================================================
--- django/conf/global_settings.py	(revision 12288)
+++ django/conf/global_settings.py	(working copy)
@@ -506,6 +506,14 @@
 TEST_DATABASE_CHARSET = None
 TEST_DATABASE_COLLATION = None
 
+# If true, the testing framework will combine the URLconf instead of overwrite
+# it if a TestCase.urls is specified
+TEST_COMBINE_URLCONFS = False
+
+# The URLconf to be combined with the TestCase.urls setting. If None, the 
+# ROOT_URLCONF specified in settings.py will be used instead.
+TEST_COMBINE_URLCONFS_WITH = None
+
 ############
 # FIXTURES #
 ############
Index: tests/regressiontests/test_client_regress/combine_urls.py
===================================================================
--- tests/regressiontests/test_client_regress/combine_urls.py	(revision 0)
+++ tests/regressiontests/test_client_regress/combine_urls.py	(revision 0)
@@ -0,0 +1,6 @@
+from django.conf.urls.defaults import *
+import views
+
+urlpatterns = patterns('',
+    url(r'^custom_arg_view/(?P<name>.+)/$', views.view_with_argument, name='custom_arg_view'),
+)
Index: tests/regressiontests/test_client_regress/models.py
===================================================================
--- tests/regressiontests/test_client_regress/models.py	(revision 12288)
+++ tests/regressiontests/test_client_regress/models.py	(working copy)
@@ -583,6 +583,29 @@
         url = reverse('arg_view', args=['somename'])
         self.assertEquals(url, '/arg_view/somename/')
 
+class UrlconfCombinationTests(TestCase):
+    urls = 'regressiontests.test_client_regress.combine_urls'
+    combine_urls = True
+
+    def test_urlconf_was_changed(self):
+        "Should have access to urls from combine_urls and ROOT_URLCONF"
+        url = reverse('arg_view', args=['somename'])
+        self.assertEquals(url, '/test_client_regress/arg_view/somename/')
+        url = reverse('custom_arg_view', args=['somename'])
+        self.assertEquals(url, '/custom_arg_view/somename/')
+
+class UrlconfCombinationWithTests(TestCase):
+    urls = 'regressiontests.test_client_regress.combine_urls'
+    combine_urls_with = 'regressiontests.test_client_regress.urls'
+    combine_urls = True
+
+    def test_urlconf_was_changed(self):
+        "Should have access to test_client_regress.combine_urls and test_client_regress.urls"
+        url = reverse('arg_view', args=['somename'])
+        self.assertEquals(url, '/arg_view/somename/')
+        url = reverse('custom_arg_view', args=['somename'])
+        self.assertEquals(url, '/custom_arg_view/somename/')
+
 # This test needs to run *after* UrlconfSubstitutionTests; the zz prefix in the
 # name is to ensure alphabetical ordering.
 class zzUrlconfSubstitutionTests(TestCase):
Index: docs/topics/testing.txt
===================================================================
--- docs/topics/testing.txt	(revision 12288)
+++ docs/topics/testing.txt	(working copy)
@@ -1054,6 +1054,21 @@
 This test case will use the contents of ``myapp.test_urls`` as the
 URLconf for the duration of the test case.
 
+.. versionadded:: 1.2
+
+The use of ``TestCase.urls`` has a downside, though. Since it overrides
+``ROOT_URLCONF``, your project's other urls will not be accessible. This is
+normally not a problem, but custom templates with reverses to external apps will
+cause the tests to raise ``NoReverseMatch`` exceptions. This problem can happen
+with :mod:`django.contrib.auth` and other apps that support custom templates and
+set ``TestCase.urls``. Custom templates that include a ``base.html`` with links to
+various places around the site are common sources of this problem.
+
+This situation can be fixed by combining the ``TestCase.urls`` with your
+project's ``ROOT_URLCONF``. You can also choose to combine a custom URLconf
+designed specifically for testing. See :setting:`TEST_COMBINE_URLCONFS` and
+:setting:`TEST_COMBINE_URLCONFS_WITH` for more information.
+
 .. _emptying-test-outbox:
 
 Multi-database support
Index: docs/ref/settings.txt
===================================================================
--- docs/ref/settings.txt	(revision 12288)
+++ docs/ref/settings.txt	(working copy)
@@ -1420,6 +1420,40 @@
 Output, as a string, that the template system should use for invalid (e.g.
 misspelled) variables. See :ref:`invalid-template-variables`..
 
+.. setting:: TEST_COMBINE_URLCONFS
+
+TEST_COMBINE_URLCONFS
+---------------------
+
+.. versionadded:: 1.2
+
+Default: ``False``
+
+If ``True``, the testing framework will combine the URLconf instead of overwrite
+it if a ``TestCase.urls`` is specified. The URLconf merged into the
+``TestCase.urls`` will be :setting:`ROOT_URLCONF` unless
+:setting:`TEST_COMBINE_URLCONFS_WITH` is set.
+
+This setting is useful for cases where apps like :mod:`django.contrib.auth` set
+``TestCase.urls`` to override the :setting:`ROOT_URLCONF` with a custom testing
+URLconf. This setting will fix the problem where custom templates with reverses
+to external apps cause the tests to fail with ``NoReverseMatch`` errors.
+
+.. setting:: TEST_COMBINE_URLCONFS_WITH
+
+TEST_COMBINE_URLCONFS_WITH
+--------------------------
+
+.. versionadded:: 1.2
+
+Default: ``None``
+
+The URLconf to be combined with the ``TestCase.urls`` setting if it is set. If
+``None``, the :setting:`ROOT_URLCONF` will be used instead. This setting will
+only be used if :setting:`TEST_COMBINE_URLCONFS` is ``True``. This can either be
+a string pointing to a module or an actual module, much like
+:setting:`ROOT_URLCONF`.
+
 .. setting:: TEST_RUNNER
 
 TEST_RUNNER
