uppercase letters, all remaining characters are lowercase.
"""
rv = []
- for item in re.compile(r'([-\s]+)(?u)').split(s):
+ for item in re.compile(r'([-\s]+)(?u)').split(soft_unicode(s)):
if not item:
continue
rv.append(item[0].upper() + item[1:])
tmpl = env.from_string('''{{ "foo\tbar"|title }}''')
assert tmpl.render() == "Foo\tBar"
+ class Foo:
+ def __str__(self):
+ return 'foo-bar'
+
+ tmpl = env.from_string('''{{ data|title }}''')
+ out = tmpl.render(data=Foo())
+ assert out == 'Foo-Bar'
+
def test_truncate(self):
tmpl = env.from_string(
'{{ data|truncate(15, true, ">>>") }}|'