#23952: Don't run all template tests with string_if_invalid='INVALID'
--------------------------------------+------------------------------------
Reporter: timgraham | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: Template system | 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
--------------------------------------+------------------------------------
Old description:
> After the template tests refactor in #23768, I don't think there's a need
> to run all the template tests with a different value of
> `TEMPLATE_STRING_IF_INVALID` (see `template_tests/syntax_tests/utils.py`.
> Instead of `if settings.TEMPLATE_STRING_IF_INVALID:` in a given test, we
> can add a second assertion to these tests and use
> `self.settings(TEMPLATE_STRING_IF_INVALID='INVALID')` and then render the
> template a second time.
New description:
After the template tests refactor in #23768, I don't think there's a need
to run all the template tests with a different value of
`string_if_invalid` (see `template_tests/syntax_tests/utils.py`. Instead
of `if self.engine.string_if_invalid:` in a given test, we can add a
second assertion to these tests and use `self.settings(TEMPLATES={...
string_if_invalid='INVALID' ...)` and then render the template a second
time.
--
Comment (by timgraham):
I updated the description to account for the `TEMPLATE_STRING_IF_INVALID`
setting moving into `TEMPLATES` `OPTIONS`. The issue
[https://github.com/django/django/blob/541000773a19d829a46fd4bec3655dca38a95551/tests/template_tests/utils.py#L66-L72
is still relevant] although the fix may not look so nice since we'd have
to override the `TEMPLATES` setting (list of dictionaries) instead of
boolean setting.
--
Ticket URL: <https://code.djangoproject.com/ticket/23952#comment:2>
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/067.65c800cc2bb9ca3c355f9fc9899ece03%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.