Jinja2 Changelog
================
-Version 2.5
------------
-(codename to be selected, release date to be announced)
+Version 2.4.1
+-------------
+(bugfix release, released on April 20th 2010)
+
+- fixed an error reporting bug for undefineds.
Version 2.4
-----------
from jinja2 import Environment, Undefined, DebugUndefined, \
StrictUndefined, UndefinedError, Template, meta
-from jinja2.utils import LRUCache, escape
+from jinja2.utils import LRUCache, escape, object_type_repr
class LRUCacheTestCase(JinjaTestCase):
assert copy._queue == cache._queue
+class HelpersTestCase(JinjaTestCase):
+
+ def test_object_type_repr(self):
+ class X(object):
+ pass
+ self.assert_equal(object_type_repr(42), 'int object')
+ self.assert_equal(object_type_repr([]), 'list object')
+ self.assert_equal(object_type_repr(X()),
+ 'jinja2.testsuite.utils.X object')
+ self.assert_equal(object_type_repr(None), 'None')
+ self.assert_equal(object_type_repr(Ellipsis), 'Ellipsis')
+
+
class MarkupLeakTestCase(JinjaTestCase):
def test_markup_leaks(self):
def suite():
suite = unittest.TestSuite()
suite.addTest(unittest.makeSuite(LRUCacheTestCase))
+ suite.addTest(unittest.makeSuite(HelpersTestCase))
# this test only tests the c extension
if not hasattr(escape, 'func_code'):
elif obj is Ellipsis:
return 'Ellipsis'
if obj.__class__.__module__ == '__builtin__':
- name = obj.__name__
+ name = obj.__class__.__name__
else:
- name = obj.__class__.module__ + '.' + obj.__name__
+ name = obj.__class__.__module__ + '.' + obj.__class__.__name__
return '%s object' % name