#29642: Add check for signatures of custom error views
-------------------------------------+-------------------------------------
Reporter: Adam (Chainz) | Owner: Adam
Johnson | (Chainz) Johnson
Type: New feature | Status: assigned
Component: Core (System | Version: master
checks) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Adam (Chainz) Johnson):
* owner: nobody => Adam (Chainz) Johnson
* status: new => assigned
Comment:
> Maybe a documentation suggestion to facilitate testing would be helpful
I did this for my initial unit tests, it only half helps since then
`exception` isn't passed. So a view which only takes one argument would
work with such a test view.
In fact the better way to test handlers is like django's test suite for
them, with other views that raise exceptions:
https://github.com/django/django/blob/master/tests/handlers/tests_custom_error_handlers.py#L23
> These "simple checks" often turn out to be more complicated than they
seem. Didn't you write some tests for your custom views? ;-)
That's the worst thing here, I did, and they were wrong. So there was a
double loop.
The check is actually quite simple and I have a draft implementation. Also
there was no check before that the given paths are genuine so this will
add defence to two different potential failures, for each of the 4
handlers.
--
Ticket URL: <https://code.djangoproject.com/ticket/29642#comment:6>
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/068.bb5c8699aef005bacc66291e97219f0c%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.