mirror of
https://github.com/django/django.git
synced 2025-10-24 14:16:09 +00:00
Converted internal link generation in the admin and admin document generator to use named URLs.
Thanks to Florian Apolloner for both the initial patch and his final push to get this fixed, to Dario Ocles for his great work on the admin templates and switching the admin_doc application to also use named URLs, to Mikko Hellsing for his comments and to Jannis and Julien for their review and design guidance. Fixes #15294. git-svn-id: http://code.djangoproject.com/svn/django/trunk@16857 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
@@ -595,7 +595,7 @@ class SaveAsTests(TestCase):
|
||||
self.assertTrue(response.context['save_as'])
|
||||
post_data = {'_saveasnew':'', 'name':'John M', 'gender':3, 'alive':'checked'}
|
||||
response = self.client.post('/test_admin/admin/admin_views/person/1/', post_data)
|
||||
self.assertEqual(response.context['form_url'], '../add/')
|
||||
self.assertEqual(response.context['form_url'], '/test_admin/admin/admin_views/person/add/')
|
||||
|
||||
class CustomModelAdminTest(AdminViewBasicTest):
|
||||
urls = "regressiontests.admin_views.urls"
|
||||
@@ -842,7 +842,7 @@ class AdminViewPermissionsTest(TestCase):
|
||||
self.client.post('/test_admin/admin/', self.adduser_login)
|
||||
addpage = self.client.get('/test_admin/admin/admin_views/article/add/')
|
||||
self.assertEqual(addpage.status_code, 200)
|
||||
change_list_link = '<a href="../">Articles</a> ›'
|
||||
change_list_link = '› <a href="/test_admin/admin/admin_views/article/">Articles</a>'
|
||||
self.assertFalse(change_list_link in addpage.content,
|
||||
'User restricted to add permission is given link to change list view in breadcrumbs.')
|
||||
post = self.client.post('/test_admin/admin/admin_views/article/add/', add_dict)
|
||||
|
||||
Reference in New Issue
Block a user