Permalink
Browse files

fixes some smaller problems for Jinja2 on Jython.

--HG--
branch : trunk
  • Loading branch information...
1 parent e7c72bc commit 9e6400e513c8795116e780f58709ffa65b2dc975 @mitsuhiko mitsuhiko committed Sep 14, 2009
Showing with 22 additions and 10 deletions.
  1. +2 −1 .hgignore
  2. +6 −0 CHANGES
  3. +1 −1 setup.py
  4. +5 −4 tests/test_ext.py
  5. +4 −4 tests/test_filters.py
  6. +4 −0 tests/test_various.py
View
@@ -4,6 +4,7 @@
^docs/_build
^(build|dist|Jinja2\.egg-info)/
\.py[co]$
+\$py\.class$
\.DS_Store$
-^env/
+^j?env/
^py3k/
View
@@ -1,6 +1,12 @@
Jinja2 Changelog
================
+Version 2.2.1
+-------------
+(bugfix release, released on September 14th 2009)
+
+- fixes some smaller problems for Jinja2 on Jython.
+
Version 2.2
-----------
(codename Kong, released on September 13th 2009)
View
@@ -49,7 +49,7 @@
setup(
name='Jinja2',
- version='2.3',
+ version='2.2.1',
url='http://jinja.pocoo.org/',
license='BSD',
author='Armin Ronacher',
View
@@ -15,7 +15,7 @@
importable_object = 23
-_gettext_re = re.compile(r'_\((.*?)\)')
+_gettext_re = re.compile(r'_\((.*?)\)(?s)')
class TestExtension(Extension):
@@ -49,7 +49,7 @@ class StreamFilterExtension(Extension):
def filter_stream(self, stream):
for token in stream:
- if token.type is 'data':
+ if token.type == 'data':
for t in self.interpolate(token):
yield t
else:
@@ -132,9 +132,10 @@ def test_preprocessor_extension():
def test_streamfilter_extension():
env = Environment(extensions=[StreamFilterExtension])
- env.globals['gettext'] = lambda x: x.title()
+ env.globals['gettext'] = lambda x: x.upper()
tmpl = env.from_string('Foo _(bar) Baz')
- assert tmpl.render() == 'Foo Bar Baz'
+ out = tmpl.render()
+ assert out == 'Foo BAR Baz'
class WithExtension(Extension):
View
@@ -89,10 +89,10 @@ def test_default():
def test_dictsort():
tmpl = env.from_string(DICTSORT)
- out = tmpl.render(foo={"a": 0, "b": 1, "c": 2, "A": 3})
- assert out == ("[('a', 0), ('A', 3), ('b', 1), ('c', 2)]|"
- "[('A', 3), ('a', 0), ('b', 1), ('c', 2)]|"
- "[('a', 0), ('b', 1), ('c', 2), ('A', 3)]")
+ out = tmpl.render(foo={"aa": 0, "b": 1, "c": 2, "AB": 3})
+ assert out == ("[('aa', 0), ('AB', 3), ('b', 1), ('c', 2)]|"
+ "[('AB', 3), ('aa', 0), ('b', 1), ('c', 2)]|"
+ "[('aa', 0), ('b', 1), ('c', 2), ('AB', 3)]")
def test_batch():
View
@@ -11,6 +11,7 @@
from jinja2.utils import Cycler
from jinja2.exceptions import TemplateSyntaxError
+from nose import SkipTest
from nose.tools import assert_raises
env = Environment()
@@ -53,6 +54,9 @@ def test_localset():
def test_markup_leaks():
+ # this test only tests the c extension
+ if hasattr(escape, 'func_code'):
+ raise SkipTest()
counts = set()
for count in xrange(20):
for item in xrange(1000):

0 comments on commit 9e6400e

Please sign in to comment.