#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 russellm): Replying to [comment:10 carljm]: > 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. I'm thinking of the case where there are *other* apps that need to inject functionality into the test client. I'm following the "special cases are never *that* special" logic. Auth has a need to inject some extra functionality into the test client (however it's done). There's no reason to believe that other apps won't have the same need. That said, to my knowledge, there isn't a huge community of 3rd party apps waiting to inject functionality into the test client. There's a possibility that this is a case of YAGNI. And regardless, this could also be done with subclassing (or mixins). This only gets complicated if there are two or more apps that provide a useful mixin - at that point, the end user doesn't have a prey-a-porter TestClient class; they need to have a testing utility library that composes the TestClient out of all the bits they need. I'm not especially invested in either approach; I don't have the same visceral reaction against contribute_to_class, but I can appreciate where that reaction comes from. -- Ticket URL: <https://code.djangoproject.com/ticket/20915#comment:11> 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.c2148d3162e349dce6d62e6b76983434%40djangoproject.com. For more options, visit https://groups.google.com/groups/opt_out.