diff options
| author | Luke Plant <L.Plant.98@cantab.net> | 2010-09-13 22:31:17 +0000 |
|---|---|---|
| committer | Luke Plant <L.Plant.98@cantab.net> | 2010-09-13 22:31:17 +0000 |
| commit | 3f9054dd777a80cb6ccba0abcad8e2b43537c123 (patch) | |
| tree | 7f62475ac018f27afeabf99bcc58d8dcd389b86e /tests | |
| parent | 4df57fb9168f835c7964e24e94f60980a5abcda4 (diff) | |
Fixed #12965 - unordered_list template filter fails when given a non-iterable second item in a two item list
Thanks to grahamu for the report and patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@13845 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/regressiontests/defaultfilters/tests.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/regressiontests/defaultfilters/tests.py b/tests/regressiontests/defaultfilters/tests.py index 8341f83e36..50aaf212ed 100644 --- a/tests/regressiontests/defaultfilters/tests.py +++ b/tests/regressiontests/defaultfilters/tests.py @@ -347,6 +347,17 @@ u'\t<li>item 1\n\t<ul>\n\t\t<li>item 1.1\n\t\t<ul>\n\t\t\t<li>item 1.1.1\n\t\t\t >>> unordered_list(['States', ['Kansas', ['Lawrence', 'Topeka'], 'Illinois']]) u'\t<li>States\n\t<ul>\n\t\t<li>Kansas\n\t\t<ul>\n\t\t\t<li>Lawrence</li>\n\t\t\t<li>Topeka</li>\n\t\t</ul>\n\t\t</li>\n\t\t<li>Illinois</li>\n\t</ul>\n\t</li>' +>>> class ULItem(object): +... def __init__(self, title): +... self.title = title +... def __unicode__(self): +... return u'ulitem-%s' % str(self.title) + +>>> a = ULItem('a') +>>> b = ULItem('b') +>>> unordered_list([a,b]) +u'\t<li>ulitem-a</li>\n\t<li>ulitem-b</li>' + # Old format for unordered lists should still work >>> unordered_list([u'item 1', []]) u'\t<li>item 1</li>' |
