settings: add django.contrib.humanize templatetags (#46290)

This commit is contained in:
Thomas NOËL 2020-09-02 14:56:34 +02:00
parent a188ba1288
commit fe4b237fd9
2 changed files with 10 additions and 0 deletions

View File

@ -997,3 +997,12 @@ def test_getlist():
assert tmpl.render({'egg': None}) == '0'
assert tmpl.render({'egg': 'spam'}) == '0'
assert tmpl.render({'egg': 42}) == '0'
def test_django_contrib_humanize_filters():
tmpl = Template('{{ foo|intcomma }}')
assert tmpl.render({'foo': 10000}) == '10,000'
assert tmpl.render({'foo': '10000'}) == '10,000'
with override_settings(LANGUAGE_CODE='fr-fr'):
assert tmpl.render({'foo': 10000}) == '10 000'
assert tmpl.render({'foo': '10000'}) == '10 000'

View File

@ -107,6 +107,7 @@ TEMPLATES = [
'builtins': [
'wcs.qommon.templatetags.qommon',
'django.templatetags.l10n',
'django.contrib.humanize.templatetags.humanize',
],
},
},