1
0
mirror of https://github.com/django/django.git synced 2025-11-07 07:15:35 +00:00

[1.11.x] Fixed #28502 -- Made stringformat template filter accept tuples.

Backport of 4ead705cb3 and
ed77bea582 from master
This commit is contained in:
Claude Paroz
2017-08-22 14:45:08 +02:00
committed by Tim Graham
parent be24b5eaa5
commit dd82f1df55
3 changed files with 7 additions and 0 deletions

View File

@@ -29,6 +29,9 @@ class FunctionTests(SimpleTestCase):
def test_format(self):
self.assertEqual(stringformat(1, '03d'), '001')
self.assertEqual(stringformat((1, 2, 3), 's'), '(1, 2, 3)')
self.assertEqual(stringformat((1,), 's'), '(1,)')
def test_invalid(self):
self.assertEqual(stringformat(1, 'z'), '')
self.assertEqual(stringformat((1, 2, 3), 'd'), '')