#23663: Commands classes are not properly testable due to their initialization
in
execute() method!
-------------------------------------+-------------------------------------
Reporter: daveoncode | Owner: nobody
Type: | Status: new
Cleanup/optimization | Version: 1.7
Component: Core (Management | Resolution:
commands) | Triage Stage:
Severity: Normal | Unreviewed
Keywords: test, tdd, | Needs documentation: 0
management, commands | Patch needs improvement: 0
Has patch: 0 | UI/UX: 0
Needs tests: 0 |
Easy pickings: 1 |
-------------------------------------+-------------------------------------
Changes (by daveoncode):
* needs_better_patch: => 0
* needs_tests: => 0
* needs_docs: => 0
Comment:
Currently I bypassed the issue by mocking '''stdout''' and '''stderr''':
class OutputMock(object):
@staticmethod
def write(message):
print message
def setUp(self):
self.command = Command()
self.command.stdout = OutputMock()
self.command.stderr = OutputMock()
--
Ticket URL: <https://code.djangoproject.com/ticket/23663#comment:1>
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.09137e250e1f48a3291a0b0217e8030b%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.