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.
* type: Uncategorized => Cleanup/optimization
* has_patch: 1 => 0
* component: Uncategorized => Testing framework
* stage: Unreviewed => Accepted
Comment:
Patch is welcome.
--
Ticket URL: <https://code.djangoproject.com/ticket/32003#comment:1>
* owner: nobody => Alexander Todorov
* status: new => assigned
* has_patch: 0 => 1
* stage: Accepted => Ready for checkin
Comment:
[https://github.com/django/django/pull/13419 PR]
--
Ticket URL: <https://code.djangoproject.com/ticket/32003#comment:2>
* status: assigned => closed
* resolution: => fixed
Comment:
In [changeset:"5fab16392fc00702a5d0288378892ec48fe67dc6" 5fab1639]:
{{{
#!CommitTicketReference repository=""
revision="5fab16392fc00702a5d0288378892ec48fe67dc6"
Fixed #32003 -- Added obj argument to has_perm() methods in tests.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/32003#comment:3>