#29885: mock called never gets set after upgrade to 2.1
-----------------------------------+--------------------------------------
Reporter: Julz | Owner: nobody
Type: Bug | Status: closed
Component: Testing framework | Version: 2.1
Severity: Normal | Resolution: invalid
Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-----------------------------------+--------------------------------------
Changes (by Simon Charette):
* status: new => closed
* resolution: => invalid
Comment:
This was probably caused by #29419.
Which is mentioned in the release notes
https://docs.djangoproject.com/en/2.1/releases/2.1/#minor-features
https://docs.djangoproject.com/en/2.1/ref/contrib/admin/actions/#setting-
permissions-for-actions
Since you are mocking the function you must make sure it doesn't have an
`allowed_permissions` attribute
https://github.com/django/django/commit/958c7b301ead79974db8edd5b9c6588a10a28ae7
#diff-3c42de3e53aba87b32c494f995a728dfR878
A simple `delattr(action_mock, 'allowed_permissions')` before the
`self.client.post` should do.
--
Ticket URL: <https://code.djangoproject.com/ticket/29885#comment:2>
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 [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/065.fd2cb76532f649772a5e7a7df312fa13%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.