#23663: Commands classes are not properly testable due to their initialization
in
execute() method!
-------------------------------------+-------------------------------------
Reporter: daveoncode | Owner: nobody
Type: | Status: closed
Cleanup/optimization | Version: 1.7
Component: Core (Management | Resolution: fixed
commands) | Triage Stage: Ready for
Severity: Normal | checkin
Keywords: test, tdd, | Needs documentation: 0
management, commands | Patch needs improvement: 0
Has patch: 1 | UI/UX: 0
Needs tests: 0 |
Easy pickings: 0 |
-------------------------------------+-------------------------------------
Comment (by Loic Bistuer <loic.bistuer@…>):
In [changeset:"eb82fb0a9d14ca317d366afb65e21d742bbe46a5"]:
{{{
#!CommitTicketReference repository=""
revision="eb82fb0a9d14ca317d366afb65e21d742bbe46a5"
Refactored color_style() and no_style() to improve testability. Refs
#23663.
This includes the following improvements:
- The type of the style object is now called 'Style' rather than 'dummy'.
- The new make_style() function allows generating a Style object directly
from a config string. Before the only way to get a style object was
through the environ and it also required that the terminal supported
colors which isn't necessarily the case when testing.
- The output of no_style() is now cached with @lru_cache.
- The output of no_style() now has the same set of attributes as the
other Style objects. Previously it allowed anything to pass through
with __getattr__.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/23663#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 [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.87d18643499f9e594f06bb0e2209ebec%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.