mirror of
https://github.com/django/django.git
synced 2025-08-03 18:38:50 +00:00
Fixed #11532 -- Corrected the link used for edit_inline foreign keys in admin when the admin is deployed using the old style admin.root approach. Thanks to JP for the report.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@11314 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
a135608d91
commit
53d16b1175
3 changed files with 16 additions and 3 deletions
|
@ -115,6 +115,7 @@ class AdminFormfieldForDBFieldWithRequestTests(DjangoTestCase):
|
|||
|
||||
class AdminForeignKeyWidgetChangeList(DjangoTestCase):
|
||||
fixtures = ["admin-widgets-users.xml"]
|
||||
admin_root = '/widget_admin'
|
||||
|
||||
def setUp(self):
|
||||
self.client.login(username="super", password="secret")
|
||||
|
@ -123,5 +124,9 @@ class AdminForeignKeyWidgetChangeList(DjangoTestCase):
|
|||
self.client.logout()
|
||||
|
||||
def test_changelist_foreignkey(self):
|
||||
response = self.client.get('/widget_admin/admin_widgets/car/')
|
||||
self.failUnless('/widget_admin/auth/user/add/' in response.content)
|
||||
response = self.client.get('%s/admin_widgets/car/' % self.admin_root)
|
||||
self.failUnless('%s/auth/user/add/' % self.admin_root in response.content)
|
||||
|
||||
class OldAdminForeignKeyWidgetChangeList(AdminForeignKeyWidgetChangeList):
|
||||
urls = 'regressiontests.admin_widgets.urls2'
|
||||
admin_root = '/deep/down/admin'
|
||||
|
|
7
tests/regressiontests/admin_widgets/urls2.py
Normal file
7
tests/regressiontests/admin_widgets/urls2.py
Normal file
|
@ -0,0 +1,7 @@
|
|||
|
||||
from django.conf.urls.defaults import *
|
||||
import widgetadmin
|
||||
|
||||
urlpatterns = patterns('',
|
||||
(r'^deep/down/admin/(.*)', widgetadmin.site.root),
|
||||
)
|
Loading…
Add table
Add a link
Reference in a new issue