#20915: Remove django.test.client dependency on django.contrib.auth (and
.sessions?)
--------------------------------------+------------------------------------
     Reporter:  ramiro                |                    Owner:  nobody
         Type:  Cleanup/optimization  |                   Status:  new
    Component:  Testing framework     |                  Version:  master
     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
--------------------------------------+------------------------------------

Comment (by carljm):

 Replying to [comment:9 mjtamlyn]:
 > Russell's approach might be nice if there are other third party apps who
 wish to push utilities into the API. I could imagine a situation where
 something like contrib.admin or an API framework or CMS system could have
 utility assertions for common patterns of testing your configuration of
 them, which might feel appropriate to be client methods.
 >
 > The issue with Carl's suggestion is that if auth provides a subclass and
 any other third party API provides a subclass merging them quickly gets
 boring, although it is the more explicit approach and it would remove the
 dependency more cleanly.

 Boring perhaps, but also trivially easy, takes advantage of ordinary
 Python programming techniques, and has all the flexibility of ordinary
 Python. Especially if the extra features are provided both as a mixin
 class and then as a Client subclass using the mixin.

 I have trouble seeing the rationale for inventing our own magical
 monkeypatching framework for this specific case, when ordinary Python has
 the tools to solve the problem.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/20915#comment:10>
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 post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/064.7d2d76f3dfc1d3b3b56a0b8d6c9342a1%40djangoproject.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to