diff --git a/tests/regressiontests/conditional_processing/models.py b/tests/regressiontests/conditional_processing/models.py index 48fe01143f..0f9bb52b52 100644 --- a/tests/regressiontests/conditional_processing/models.py +++ b/tests/regressiontests/conditional_processing/models.py @@ -16,6 +16,8 @@ EXPIRED_ETAG = '7fae4cd4b0f81e7d2914700043aa8ed6' class ConditionalGet(TestCase): + urls = 'regressiontests.conditional_processing.urls' + def assertFullResponse(self, response, check_last_modified=True, check_etag=True): self.assertEqual(response.status_code, 200) self.assertEqual(response.content, FULL_RESPONSE) diff --git a/tests/regressiontests/conditional_processing/urls.py b/tests/regressiontests/conditional_processing/urls.py index 4dbe11a230..8c1f465464 100644 --- a/tests/regressiontests/conditional_processing/urls.py +++ b/tests/regressiontests/conditional_processing/urls.py @@ -2,9 +2,9 @@ from django.conf.urls.defaults import * import views urlpatterns = patterns('', - ('^$', views.index), - ('^last_modified/$', views.last_modified_view1), - ('^last_modified2/$', views.last_modified_view2), - ('^etag/$', views.etag_view1), - ('^etag2/$', views.etag_view2), + ('^condition/$', views.index), + ('^condition/last_modified/$', views.last_modified_view1), + ('^condition/last_modified2/$', views.last_modified_view2), + ('^condition/etag/$', views.etag_view1), + ('^condition/etag2/$', views.etag_view2), ) diff --git a/tests/regressiontests/middleware_exceptions/tests.py b/tests/regressiontests/middleware_exceptions/tests.py index ac0f47a0f7..ac5f09a0a8 100644 --- a/tests/regressiontests/middleware_exceptions/tests.py +++ b/tests/regressiontests/middleware_exceptions/tests.py @@ -94,6 +94,8 @@ class BadExceptionMiddleware(TestMiddleware): class BaseMiddlewareExceptionTest(TestCase): + urls = 'regressiontests.middleware_exceptions.urls' + def setUp(self): self.exceptions = [] got_request_exception.connect(self._on_request_exception) @@ -768,6 +770,8 @@ class BadMiddlewareTests(BaseMiddlewareExceptionTest): _missing = object() class RootUrlconfTests(TestCase): + urls = 'regressiontests.middleware_exceptions.urls' + def test_missing_root_urlconf(self): try: original_ROOT_URLCONF = settings.ROOT_URLCONF diff --git a/tests/regressiontests/middleware_exceptions/urls.py b/tests/regressiontests/middleware_exceptions/urls.py index 37d47f796a..72c690fa41 100644 --- a/tests/regressiontests/middleware_exceptions/urls.py +++ b/tests/regressiontests/middleware_exceptions/urls.py @@ -4,12 +4,12 @@ from django.conf.urls.defaults import * import views urlpatterns = patterns('', - (r'^view/$', views.normal_view), - (r'^not_found/$', views.not_found), - (r'^error/$', views.server_error), - (r'^null_view/$', views.null_view), - (r'^permission_denied/$', views.permission_denied), + (r'^middleware_exceptions/view/$', views.normal_view), + (r'^middleware_exceptions/not_found/$', views.not_found), + (r'^middleware_exceptions/error/$', views.server_error), + (r'^middleware_exceptions/null_view/$', views.null_view), + (r'^middleware_exceptions/permission_denied/$', views.permission_denied), - (r'^template_response/$', views.template_response), - (r'^template_response_error/$', views.template_response_error), + (r'^middleware_exceptions/template_response/$', views.template_response), + (r'^middleware_exceptions/template_response_error/$', views.template_response_error), ) diff --git a/tests/regressiontests/special_headers/tests.py b/tests/regressiontests/special_headers/tests.py index 85cded3b50..45e6a82b2b 100644 --- a/tests/regressiontests/special_headers/tests.py +++ b/tests/regressiontests/special_headers/tests.py @@ -6,6 +6,7 @@ from django.contrib.auth.models import User class SpecialHeadersTest(TestCase): fixtures = ['data.xml'] + urls = 'regressiontests.special_headers.urls' def setUp(self): self.save_warnings_state() diff --git a/tests/regressiontests/special_headers/urls.py b/tests/regressiontests/special_headers/urls.py index c6b05d6266..5d223fdb79 100644 --- a/tests/regressiontests/special_headers/urls.py +++ b/tests/regressiontests/special_headers/urls.py @@ -5,7 +5,7 @@ from models import Article import views urlpatterns = patterns('', - (r'^article/(?P\d+)/$', object_detail, {'queryset': Article.objects.all()}), - (r'^xview/func/$', views.xview_dec(views.xview)), - (r'^xview/class/$', views.xview_dec(views.XViewClass.as_view())), + (r'^special_headers/article/(?P\d+)/$', object_detail, {'queryset': Article.objects.all()}), + (r'^special_headers/xview/func/$', views.xview_dec(views.xview)), + (r'^special_headers/xview/class/$', views.xview_dec(views.XViewClass.as_view())), ) diff --git a/tests/regressiontests/syndication/tests.py b/tests/regressiontests/syndication/tests.py index 3a2d7ebd74..58e6373d44 100644 --- a/tests/regressiontests/syndication/tests.py +++ b/tests/regressiontests/syndication/tests.py @@ -35,6 +35,7 @@ class SyndicationFeedTest(FeedTestCase): """ Tests for the high-level syndication feed framework. """ + urls = 'regressiontests.syndication.urls' def test_rss2_feed(self): """ diff --git a/tests/regressiontests/syndication/urls.py b/tests/regressiontests/syndication/urls.py index e3dbc02665..1f7ab73f71 100644 --- a/tests/regressiontests/syndication/urls.py +++ b/tests/regressiontests/syndication/urls.py @@ -3,14 +3,14 @@ from django.conf.urls.defaults import * import feeds urlpatterns = patterns('django.contrib.syndication.views', - (r'^complex/(?P.*)/$', feeds.ComplexFeed()), - (r'^rss2/$', feeds.TestRss2Feed()), - (r'^rss091/$', feeds.TestRss091Feed()), - (r'^atom/$', feeds.TestAtomFeed()), - (r'^custom/$', feeds.TestCustomFeed()), - (r'^naive-dates/$', feeds.NaiveDatesFeed()), - (r'^aware-dates/$', feeds.TZAwareDatesFeed()), - (r'^feedurl/$', feeds.TestFeedUrlFeed()), - (r'^articles/$', feeds.ArticlesFeed()), - (r'^template/$', feeds.TemplateFeed()), + (r'^syndication/complex/(?P.*)/$', feeds.ComplexFeed()), + (r'^syndication/rss2/$', feeds.TestRss2Feed()), + (r'^syndication/rss091/$', feeds.TestRss091Feed()), + (r'^syndication/atom/$', feeds.TestAtomFeed()), + (r'^syndication/custom/$', feeds.TestCustomFeed()), + (r'^syndication/naive-dates/$', feeds.NaiveDatesFeed()), + (r'^syndication/aware-dates/$', feeds.TZAwareDatesFeed()), + (r'^syndication/feedurl/$', feeds.TestFeedUrlFeed()), + (r'^syndication/articles/$', feeds.ArticlesFeed()), + (r'^syndication/template/$', feeds.TemplateFeed()), ) diff --git a/tests/regressiontests/test_utils/tests.py b/tests/regressiontests/test_utils/tests.py index 8d23cf5501..f4b836a792 100644 --- a/tests/regressiontests/test_utils/tests.py +++ b/tests/regressiontests/test_utils/tests.py @@ -19,6 +19,8 @@ class SkippingTestCase(TestCase): class AssertNumQueriesTests(TestCase): + urls = 'regressiontests.test_utils.urls' + def test_assert_num_queries(self): def test_func(): raise ValueError @@ -48,6 +50,8 @@ class AssertNumQueriesTests(TestCase): self.assertNumQueries(2, test_func) class AssertNumQueriesContextManagerTests(TestCase): + urls = 'regressiontests.test_utils.urls' + def test_simple(self): with self.assertNumQueries(0): pass diff --git a/tests/regressiontests/test_utils/urls.py b/tests/regressiontests/test_utils/urls.py index 2c5821bc44..f3df170835 100644 --- a/tests/regressiontests/test_utils/urls.py +++ b/tests/regressiontests/test_utils/urls.py @@ -4,5 +4,5 @@ import views urlpatterns = patterns('', - (r'^get_person/(\d+)/$', views.get_person), + (r'^test_utils/get_person/(\d+)/$', views.get_person), ) diff --git a/tests/urls.py b/tests/urls.py index d254407cc4..77a75784ec 100644 --- a/tests/urls.py +++ b/tests/urls.py @@ -30,19 +30,4 @@ urlpatterns = patterns('', (r'widget_admin/', include('regressiontests.admin_widgets.urls')), (r'^utils/', include('regressiontests.utils.urls')), - - # test urlconf for syndication tests - (r'^syndication/', include('regressiontests.syndication.urls')), - - # conditional get views - (r'condition/', include('regressiontests.conditional_processing.urls')), - - # middleware exceptions tests - (r'middleware_exceptions/', include('regressiontests.middleware_exceptions.urls')), - - # special headers views - (r'special_headers/', include('regressiontests.special_headers.urls')), - - # test util views - (r'test_utils/', include('regressiontests.test_utils.urls')), )