1
0
mirror of https://github.com/django/django.git synced 2025-11-07 07:15:35 +00:00

Updated tests for deprecation of Option.get_(add|change|delete)_permission.

refs #20642.
This commit is contained in:
Tim Graham
2013-07-01 09:19:55 -04:00
parent cfcf4b3605
commit a6a905c619
2 changed files with 10 additions and 8 deletions

View File

@@ -3,6 +3,7 @@ from __future__ import unicode_literals
import datetime
import decimal
from django.contrib.auth import get_permission_codename
from django.db import models
from django.db.models.constants import LOOKUP_SEP
from django.db.models.deletion import Collector
@@ -119,7 +120,7 @@ def get_deleted_objects(objs, opts, user, admin_site, using):
opts.model_name),
None, (quote(obj._get_pk_val()),))
p = '%s.%s' % (opts.app_label,
opts.get_delete_permission())
get_permission_codename('delete', opts))
if not user.has_perm(p):
perms_needed.add(opts.verbose_name)
# Display a link to the admin page.