summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArmin Ronacher <armin.ronacher@active-4.com>2010-07-01 11:30:42 +0200
committerArmin Ronacher <armin.ronacher@active-4.com>2010-07-01 11:30:42 +0200
commit02ea18a29d171767fc3f224d9e8e5303977f80f2 (patch)
tree6616b9bc2389e986549950b1d3eac4050cc6bd42
parent850629f1c329e1947a43735170fcf8fb35e08cce (diff)
downloadjinja2-02ea18a29d171767fc3f224d9e8e5303977f80f2.tar.gz
We will have a 2.5.1 release
--HG-- branch : trunk
-rw-r--r--CHANGES6
-rw-r--r--jinja2/_speedups.c1
-rw-r--r--jinja2/testsuite/ext.py10
3 files changed, 12 insertions, 5 deletions
diff --git a/CHANGES b/CHANGES
index 5f2d6c6..133a913 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,9 +1,9 @@
Jinja2 Changelog
================
-Version 2.6
------------
-(codename to be selected, release date to be announced)
+Version 2.5.1
+-------------
+(bugfix release, release date to be announced)
- StopIteration exceptions raised by functions called from templates
are now intercepted and converted to undefineds. This solves a
diff --git a/jinja2/_speedups.c b/jinja2/_speedups.c
index 3b2d71c..5c7ff2d 100644
--- a/jinja2/_speedups.c
+++ b/jinja2/_speedups.c
@@ -202,7 +202,6 @@ tb_set_next(PyObject *self, PyObject *args)
return Py_None;
}
-
static PyMethodDef module_methods[] = {
{"escape", (PyCFunction)escape, METH_O,
"escape(s) -> markup\n\n"
diff --git a/jinja2/testsuite/ext.py b/jinja2/testsuite/ext.py
index 338308c..f252d67 100644
--- a/jinja2/testsuite/ext.py
+++ b/jinja2/testsuite/ext.py
@@ -51,7 +51,9 @@ newstyle_i18n_templates = {
'stringformat.html': '{{ _("User: %(num)s", num=user_count) }}',
'ngettext.html': '{{ ngettext("%(num)s apple", "%(num)s apples", apples) }}',
'ngettext_long.html': '{% trans num=apples %}{{ num }} apple{% pluralize %}'
- '{{ num }} apples{% endtrans %}'
+ '{{ num }} apples{% endtrans %}',
+ 'transvars1.html': '{% trans %}User: {{ num }}{% endtrans %}',
+ 'transvars2.html': '{% trans num=count %}User: {{ num }}{% endtrans %}'
}
@@ -345,6 +347,12 @@ class NewstyleInternationalizationTestCase(JinjaTestCase):
assert re.search(r"l_ngettext, u?'\%\(num\)s apple', u?'\%\(num\)s "
r"apples', 3", source) is not None
+ def test_trans_vars(self):
+ t1 = newstyle_i18n_env.get_template('transvars1.html')
+ t2 = newstyle_i18n_env.get_template('transvars2.html')
+ assert t1.render(num=1, LANGUAGE='de') == 'Benutzer: 1'
+ assert t2.render(count=23, LANGUAGE='de') == 'Benutzer: 23'
+
class AutoEscapeTestCase(JinjaTestCase):