Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add some simple regression tests for the truncatechars filter. Refs #…

…16510.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@16551 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 34a71dc4e4c1f09da7fd47a566c4ae5965bc2f42 1 parent afd8a47
@SmileyChris SmileyChris authored
Showing with 3 additions and 0 deletions.
  1. +3 −0  tests/regressiontests/templates/filters.py
View
3  tests/regressiontests/templates/filters.py
@@ -134,6 +134,9 @@ def get_filter_tests():
'filter-truncatewords02': ('{{ a|truncatewords:"2" }} {{ b|truncatewords:"2"}}',
{"a": "alpha & bravo", "b": mark_safe("alpha & bravo")}, u"alpha & ... alpha & ..."),
+ 'filter-truncatechars01': ('{{ a|truncatechars:5 }}', {'a': "Testing, testing"}, u"Te..."),
+ 'filter-truncatechars02': ('{{ a|truncatechars:7 }}', {'a': "Testing"}, u"Testing"),
+
# The "upper" filter messes up entities (which are case-sensitive),
# so it's not safe for non-escaping purposes.
'filter-upper01': ('{% autoescape off %}{{ a|upper }} {{ b|upper }}{% endautoescape %}', {"a": "a & b", "b": mark_safe("a & b")}, u"A & B A & B"),
Please sign in to comment.
Something went wrong with that request. Please try again.