Loading setup.cfg +1 −1 Original line number Diff line number Diff line Loading @@ -3,7 +3,7 @@ doc_files = docs extras AUTHORS INSTALL LICENSE README.rst install-script = scripts/rpm-install.sh [flake8] exclude = build,.git,./django/utils/lru_cache.py,./django/utils/six.py,./django/conf/app_template/*,./django/dispatch/weakref_backports.py,./tests/.env,./xmlrunner,tests/view_tests/tests/py3_test_debug.py exclude = build,.git,./django/utils/lru_cache.py,./django/utils/six.py,./django/conf/app_template/*,./django/dispatch/weakref_backports.py,./tests/.env,./xmlrunner,tests/view_tests/tests/py3_test_debug.py,tests/template_tests/annotated_tag_function.py ignore = E123,E128,E402,W503,E731,W601 max-line-length = 119 Loading tests/template_tests/annotated_tag_function.py 0 → 100644 +8 −0 Original line number Diff line number Diff line from django import template register = template.Library() @register.simple_tag() def annotated_tag_function(val: int): return val tests/template_tests/test_custom.py +7 −0 Original line number Diff line number Diff line from __future__ import unicode_literals import os from unittest import skipUnless from django.template import Context, Engine, TemplateSyntaxError from django.template.base import Node Loading Loading @@ -380,3 +381,9 @@ class TemplateTagLoadingTests(SimpleTestCase): 'working_egg': 'tagsegg.templatetags.working_egg', }) engine.from_string(ttext) @skipUnless(six.PY3, "Python 3 only -- Python 2 doesn't have annotations.") def test_load_annotated_function(self): Engine(libraries={ 'annotated_tag_function': 'template_tests.annotated_tag_function', }) Loading
setup.cfg +1 −1 Original line number Diff line number Diff line Loading @@ -3,7 +3,7 @@ doc_files = docs extras AUTHORS INSTALL LICENSE README.rst install-script = scripts/rpm-install.sh [flake8] exclude = build,.git,./django/utils/lru_cache.py,./django/utils/six.py,./django/conf/app_template/*,./django/dispatch/weakref_backports.py,./tests/.env,./xmlrunner,tests/view_tests/tests/py3_test_debug.py exclude = build,.git,./django/utils/lru_cache.py,./django/utils/six.py,./django/conf/app_template/*,./django/dispatch/weakref_backports.py,./tests/.env,./xmlrunner,tests/view_tests/tests/py3_test_debug.py,tests/template_tests/annotated_tag_function.py ignore = E123,E128,E402,W503,E731,W601 max-line-length = 119 Loading
tests/template_tests/annotated_tag_function.py 0 → 100644 +8 −0 Original line number Diff line number Diff line from django import template register = template.Library() @register.simple_tag() def annotated_tag_function(val: int): return val
tests/template_tests/test_custom.py +7 −0 Original line number Diff line number Diff line from __future__ import unicode_literals import os from unittest import skipUnless from django.template import Context, Engine, TemplateSyntaxError from django.template.base import Node Loading Loading @@ -380,3 +381,9 @@ class TemplateTagLoadingTests(SimpleTestCase): 'working_egg': 'tagsegg.templatetags.working_egg', }) engine.from_string(ttext) @skipUnless(six.PY3, "Python 3 only -- Python 2 doesn't have annotations.") def test_load_annotated_function(self): Engine(libraries={ 'annotated_tag_function': 'template_tests.annotated_tag_function', })