#32003: tests: Signature of mocked User.has_perm() different from real implementation ---------------------------------------------+------------------------ Reporter: Alexander Todorov | Owner: nobody Type: Uncategorized | Status: new Component: Uncategorized | Version: 3.1 Severity: Normal | Keywords: Triage Stage: Unreviewed | Has patch: 1 Needs documentation: 0 | Needs tests: 0 Patch needs improvement: 0 | Easy pickings: 0 UI/UX: 0 | ---------------------------------------------+------------------------ In particular all of the mocked methods receive 2 arguments: self, perm while the real one in PermissionsMixin also has a keyword agument called obj.
This gets in the way of trying to work on passing the object to user.has_perm() in ModelAdmin because it will cause the tests to fail artificially. I have a commit at https://github.com/atodorov/django/commits/fix_mocked_has_perm which doesn't fail locally and seems to do the job. Let me know if you want me to open a pull request. -- Ticket URL: <https://code.djangoproject.com/ticket/32003> Django <https://code.djangoproject.com/> The Web framework for perfectionists with deadlines. -- You received this message because you are subscribed to the Google Groups "Django updates" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-updates+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/051.e1e0048fe3ecd1025757523fd2e07583%40djangoproject.com.