mirror of
https://github.com/django/django.git
synced 2025-10-31 09:41:08 +00:00
newforms-admin: custom URL handling in admin now redirects to add trailing slash if needed - this fixes several bugs that occurred when you navigated to an admin page and omitted the trailing slash.
git-svn-id: http://code.djangoproject.com/svn/django/branches/newforms-admin@7825 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
@@ -74,7 +74,19 @@ class AdminViewPermissionsTest(TestCase):
|
||||
'username': 'joepublic',
|
||||
'password': 'secret'}
|
||||
|
||||
def testTrailingSlashRequired(self):
|
||||
"""
|
||||
If you leave off the trailing slash, app should redirect and add it.
|
||||
"""
|
||||
self.client.post('/test_admin/admin/', self.super_login)
|
||||
|
||||
request = self.client.get(
|
||||
'/test_admin/admin/admin_views/article/add'
|
||||
)
|
||||
self.assertRedirects(request,
|
||||
'/test_admin/admin/admin_views/article/add/'
|
||||
)
|
||||
|
||||
def testLogin(self):
|
||||
"""
|
||||
Make sure only staff members can log in.
|
||||
|
||||
Reference in New Issue
Block a user