#9159: testing Client support for middleware
----------------------------------------+-----------------------------------
Reporter: hvendelbo | Owner: nobody
Status: closed | Milestone:
Component: Testing framework | Version: 1.0
Resolution: wontfix | Keywords: middleware testclient
Stage: Unreviewed | Has_patch: 1
Needs_docs: 0 | Needs_tests: 0
Needs_better_patch: 0 |
----------------------------------------+-----------------------------------
Changes (by russellm):
* status: new => closed
* resolution: => wontfix
Comment:
Replying to [comment:1 carljm]:
> Not resolving since I'm not a triager (someone higher up tell me if I
should've just gone ahead and resolved this), but almost certain this is a
wontfix.
Right on the money.
If you want to test middleware, test the middleware. A middleware is just
two methods on a class; if you want to test the middleware, call those
functions from your tests. Munging the entire test client to make it
"easier" to invoke those methods is entirely the wrong way to go.
The only complication is that faking a request object to pass to the
middleware method isn't completely trivial. The solution, therefore, is to
make it easier to create a request object. #9002 contains a proposal for
doing this that doesn't require so much duct tape.
On a completely procedural note - the patch also needs tests. As Malcolm
noted in his DjangoCon talk - submitting a patch without tests is
shorthand for "Here are some bugs I thought you should have". If you want
your contributions to be taken seriously, write the tests first.
--
Ticket URL: <http://code.djangoproject.com/ticket/9159#comment:2>
Django <http://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 post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---