diff --git a/django/contrib/admin/options.py b/django/contrib/admin/options.py
index c87d903..f69587b 100644
a
|
b
|
class ModelAdmin(BaseModelAdmin):
|
1010 | 1010 | if perms_needed: |
1011 | 1011 | raise PermissionDenied |
1012 | 1012 | obj_display = force_unicode(obj) |
| 1013 | self.log_deletion(request, obj, obj_display) |
1013 | 1014 | obj.delete() |
1014 | 1015 | |
1015 | | self.log_deletion(request, obj, obj_display) |
1016 | 1016 | self.message_user(request, _('The %(name)s "%(obj)s" was deleted successfully.') % {'name': force_unicode(opts.verbose_name), 'obj': force_unicode(obj_display)}) |
1017 | 1017 | |
1018 | 1018 | if not self.has_change_permission(request, None): |
diff --git a/tests/regressiontests/admin_views/tests.py b/tests/regressiontests/admin_views/tests.py
index 3d75967..5e1b35e 100644
a
|
b
|
from django.core.files import temp as tempfile
|
6 | 6 | from django.test import TestCase |
7 | 7 | from django.contrib.auth.models import User, Permission |
8 | 8 | from django.contrib.contenttypes.models import ContentType |
9 | | from django.contrib.admin.models import LogEntry |
| 9 | from django.contrib.admin.models import LogEntry, DELETION |
10 | 10 | from django.contrib.admin.sites import LOGIN_FORM_KEY |
11 | 11 | from django.contrib.admin.util import quote |
12 | 12 | from django.contrib.admin.helpers import ACTION_CHECKBOX_NAME |
… |
… |
class AdminViewPermissionsTest(TestCase):
|
544 | 544 | post = self.client.post('/test_admin/admin/admin_views/article/1/delete/', delete_dict) |
545 | 545 | self.assertRedirects(post, '/test_admin/admin/') |
546 | 546 | self.failUnlessEqual(Article.objects.all().count(), 2) |
| 547 | article_ct = ContentType.objects.get_for_model(Article) |
| 548 | logged = LogEntry.objects.get(content_type=article_ct, action_flag=DELETION) |
| 549 | self.failUnlessEqual(logged.object_id, u'1') |
547 | 550 | self.client.get('/test_admin/admin/logout/') |
548 | 551 | |
549 | 552 | class AdminViewStringPrimaryKeyTest(TestCase): |