diff options
| author | Russell Keith-Magee <russell@keith-magee.com> | 2010-04-05 12:08:45 +0000 |
|---|---|---|
| committer | Russell Keith-Magee <russell@keith-magee.com> | 2010-04-05 12:08:45 +0000 |
| commit | c01735dee7dd590963c0305a2f2c904cd6cdefc2 (patch) | |
| tree | aeaeaa4bbdccffbcaf50f70c23ba729c9f3628a4 /tests/regressiontests | |
| parent | 0d6a776ccd9a6035b97389ca57fee41dd7454e01 (diff) | |
[1.1.X] Fixed #11949 -- Added a hook to allow ModelAdmin customization of the delete selected template. Thanks to bendavis78 for the report and patch, and Ramiro Morales for his cleanup work.
Backport of r12916 from trunk.
git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.1.X@12917 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests/regressiontests')
| -rw-r--r-- | tests/regressiontests/admin_views/models.py | 1 | ||||
| -rw-r--r-- | tests/regressiontests/admin_views/tests.py | 6 |
2 files changed, 7 insertions, 0 deletions
diff --git a/tests/regressiontests/admin_views/models.py b/tests/regressiontests/admin_views/models.py index 0caa8946c1..cf714631bc 100644 --- a/tests/regressiontests/admin_views/models.py +++ b/tests/regressiontests/admin_views/models.py @@ -115,6 +115,7 @@ class CustomArticleAdmin(admin.ModelAdmin): change_form_template = 'custom_admin/change_form.html' object_history_template = 'custom_admin/object_history.html' delete_confirmation_template = 'custom_admin/delete_confirmation.html' + delete_selected_confirmation_template = 'custom_admin/delete_selected_confirmation.html' def changelist_view(self, request): "Test that extra_context works" diff --git a/tests/regressiontests/admin_views/tests.py b/tests/regressiontests/admin_views/tests.py index 129f93cdac..c297e37a43 100644 --- a/tests/regressiontests/admin_views/tests.py +++ b/tests/regressiontests/admin_views/tests.py @@ -579,6 +579,12 @@ class AdminViewPermissionsTest(TestCase): # Test custom delete and object history templates request = self.client.get('/test_admin/admin/admin_views/customarticle/1/delete/') self.assertTemplateUsed(request, 'custom_admin/delete_confirmation.html') + request = self.client.post('/test_admin/admin/admin_views/customarticle/', data={ + 'index': 0, + 'action': ['delete_selected'], + '_selected_action': ['1'], + }) + self.assertTemplateUsed(request, 'custom_admin/delete_selected_confirmation.html') request = self.client.get('/test_admin/admin/admin_views/customarticle/1/history/') self.assertTemplateUsed(request, 'custom_admin/object_history.html') |
