Skip to content

Instantly share code, notes, and snippets.

@jsocol
Created December 11, 2015 17:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jsocol/c6236c0483b79963f705 to your computer and use it in GitHub Desktop.
Save jsocol/c6236c0483b79963f705 to your computer and use it in GitHub Desktop.
failing test for jingo#76
diff --git a/jingo/tests/jinja_app/helpers.py b/jingo/tests/jinja_app/helpers.py
new file mode 100644
index 0000000..62f344d
--- /dev/null
+++ b/jingo/tests/jinja_app/helpers.py
@@ -0,0 +1,8 @@
+from __future__ import absolute_import, unicode_literals
+
+from jingo import register
+
+
+@register.filter
+def test_issue_76(anything):
+ return 'was imported'
diff --git a/jingo/tests/test_helpers.py b/jingo/tests/test_helpers.py
index 1450236..9b5c099 100644
--- a/jingo/tests/test_helpers.py
+++ b/jingo/tests/test_helpers.py
@@ -276,3 +276,9 @@ def test_urlparams_fragment():
eq_(u'/#foo', helpers.urlparams('/', fragment='foo'))
eq_(u'/#bar', helpers.urlparams('/#foo', fragment='bar'))
eq_(u'/', helpers.urlparams('/#foo', fragment=''))
+
+
+def test_helper_autodiscovery():
+ """jingo.tests.jinja_app.helpers.test_issue_76 should be available."""
+ s = render('{{ "f"|test_issue_76 }}')
+ eq_('was imported', s)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment