mirror of
https://github.com/django/django.git
synced 2025-10-31 09:41:08 +00:00
Added test for various widths in tests/template_tests/filter_tests/test_center.py.
This commit is contained in:
@@ -34,3 +34,9 @@ class FunctionTests(SimpleTestCase):
|
|||||||
|
|
||||||
def test_non_string_input(self):
|
def test_non_string_input(self):
|
||||||
self.assertEqual(center(123, 5), " 123 ")
|
self.assertEqual(center(123, 5), " 123 ")
|
||||||
|
|
||||||
|
def test_widths(self):
|
||||||
|
value = "something"
|
||||||
|
for i in range(-1, len(value) + 1):
|
||||||
|
with self.subTest(i=i):
|
||||||
|
self.assertEqual(center(value, i), value)
|
||||||
|
|||||||
Reference in New Issue
Block a user