mirror of
				https://github.com/django/django.git
				synced 2025-10-31 09:41:08 +00:00 
			
		
		
		
	[1.10.x] Fixed #24931 -- Made namespaced RegexURLResolvers populate callback strings.
Fixed a regression in2f16ff5a6c. Thanks Tim Graham for the review. Backport of625b8e9295from master
This commit is contained in:
		
				
					committed by
					
						 Tim Graham
						Tim Graham
					
				
			
			
				
	
			
			
			
						parent
						
							1213ef2b18
						
					
				
				
					commit
					31a789f646
				
			
							
								
								
									
										14
									
								
								tests/admin_docs/namespace_urls.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										14
									
								
								tests/admin_docs/namespace_urls.py
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,14 @@ | ||||
| from django.conf.urls import include, url | ||||
| from django.contrib import admin | ||||
|  | ||||
| from . import views | ||||
|  | ||||
| backend_urls = ([ | ||||
|     url(r'^something/$', views.XViewClass.as_view(), name='something'), | ||||
| ], 'backend') | ||||
|  | ||||
| urlpatterns = [ | ||||
|     url(r'^admin/doc/', include('django.contrib.admindocs.urls')), | ||||
|     url(r'^admin/', admin.site.urls), | ||||
|     url(r'^api/backend/', include(backend_urls, namespace='backend')), | ||||
| ] | ||||
| @@ -88,6 +88,12 @@ class AdminDocViewTests(TestDataMixin, AdminDocsTestCase): | ||||
|         # View docstring | ||||
|         self.assertContains(response, 'Base view for admindocs views.') | ||||
|  | ||||
|     @override_settings(ROOT_URLCONF='admin_docs.namespace_urls') | ||||
|     def test_namespaced_view_detail(self): | ||||
|         url = reverse('django-admindocs-views-detail', args=['admin_docs.views.XViewClass']) | ||||
|         response = self.client.get(url) | ||||
|         self.assertContains(response, '<h1>admin_docs.views.XViewClass</h1>') | ||||
|  | ||||
|     def test_view_detail_illegal_import(self): | ||||
|         """ | ||||
|         #23601 - Ensure the view exists in the URLconf. | ||||
|   | ||||
		Reference in New Issue
	
	Block a user