diff --git a/django/contrib/admin/options.py b/django/contrib/admin/options.py
index 3a0ad74..83cb4eb 100644
a
|
b
|
class ModelAdmin(BaseModelAdmin):
|
1009 | 1009 | |
1010 | 1010 | @csrf_protect_m |
1011 | 1011 | @transaction.commit_on_success |
1012 | | def change_view(self, request, object_id, extra_context=None): |
| 1012 | def change_view(self, request, object_id, form_url='', extra_context=None): |
1013 | 1013 | "The 'change' admin view for this model." |
1014 | 1014 | model = self.model |
1015 | 1015 | opts = model._meta |
diff --git a/tests/regressiontests/admin_views/tests.py b/tests/regressiontests/admin_views/tests.py
index b0120ce..24c5d85 100644
a
|
b
|
class AdminViewBasicTest(TestCase):
|
573 | 573 | except SuspiciousOperation: |
574 | 574 | self.fail("Filters should be allowed if they are defined on a ForeignKey pointing to this model") |
575 | 575 | |
| 576 | class AdminViewFormUrlTest(TestCase): |
| 577 | urls = "regressiontests.admin_views.urls" |
| 578 | fixtures = ["admin-views-users.xml"] |
| 579 | urlbit = "admin3" |
| 580 | |
| 581 | def setUp(self): |
| 582 | self.client.login(username='super', password='secret') |
| 583 | |
| 584 | def tearDown(self): |
| 585 | self.client.logout() |
| 586 | |
| 587 | def testChangeFormUrlHasCorrectValue(self): |
| 588 | """ |
| 589 | Tests whether change_view has form_url in request.context |
| 590 | """ |
| 591 | response = self.client.get('/test_admin/%s/admin_views/section/1/' % self.urlbit) |
| 592 | self.assertTrue('form_url' in response.context, msg='form_url not present in response.context') |
| 593 | self.assertEqual(response.context['form_url'], 'pony') |
| 594 | |
576 | 595 | class AdminJavaScriptTest(AdminViewBasicTest): |
577 | 596 | urls = "regressiontests.admin_views.urls" |
578 | 597 | |
diff --git a/tests/regressiontests/admin_views/urls.py b/tests/regressiontests/admin_views/urls.py
index 03bfbf0..da6e2cb 100644
a
|
b
|
urlpatterns = patterns('',
|
10 | 10 | (r'^test_admin/admin/secure-view/$', views.secure_view), |
11 | 11 | (r'^test_admin/admin/', include(admin.site.urls)), |
12 | 12 | (r'^test_admin/admin2/', include(customadmin.site.urls)), |
| 13 | (r'^test_admin/admin3/', include(admin.site.urls), dict(form_url='pony')), |
13 | 14 | ) |