Make the test Client class variable in TransactionTestCase
|Reported by:||obeattie||Owned by:||nobody|
|Has patch:||yes||Needs documentation:||yes|
|Needs tests:||yes||Patch needs improvement:||yes|
I have a subclass of Django's TransactionTestCase, and I would also like to be able to specify my own subclass of Client to use as the test's client. However, at the moment, this requires me to basically copy-and-paste all of the code out of the TransactionTestCase's __call__ method, as the Client class is hard-coded into that function. This also makes the use of super on the subclasses' __call__ method impossible, as the client instance variable would just be reset to an instance of Client by TransactionTestCase.
If it were made to be a class variable, subclasses could easily change this without having to override the __call__ method. I've attached a diff proposal.
Change History (3)
Changed 4 years ago by obeattie
comment:1 Changed 4 years ago by russellm
- Has patch set
- Needs documentation set
- Needs tests set
- Patch needs improvement set
- Triage Stage changed from Unreviewed to Accepted