Refs #28502 -- Completed stringformat filter tests
This commit is contained in:
parent
6784383e93
commit
a64f88f5be
|
@ -29,6 +29,11 @@ class FunctionTests(SimpleTestCase):
|
|||
|
||||
def test_format(self):
|
||||
self.assertEqual(stringformat(1, '03d'), '001')
|
||||
self.assertEqual(stringformat([1, None], 's'), '[1, None]')
|
||||
self.assertEqual(stringformat({1, 2}, 's'), '{1, 2}')
|
||||
self.assertEqual(stringformat({1: 2, 2: 3}, 's'), '{1: 2, 2: 3}')
|
||||
|
||||
def test_invalid(self):
|
||||
self.assertEqual(stringformat(1, 'z'), '')
|
||||
self.assertEqual(stringformat(object(), 'd'), '')
|
||||
self.assertEqual(stringformat(None, 'd'), '')
|
||||
|
|
Loading…
Reference in New Issue