MCPcopy
hub / github.com/django/django / test_localized_off_numbers

Method test_localized_off_numbers

tests/i18n/tests.py:1443–1458  ·  view source on GitHub ↗

A string representation is returned for unlocalized numbers.

(self)

Source from the content-addressed store, hash-verified

1441 self.assertEqual(template3.render(context), output3)
1442
1443 def test_localized_off_numbers(self):
1444 """A string representation is returned for unlocalized numbers."""
1445 template = Template(
1446 "{% load l10n %}{% localize off %}"
1447 "{{ int }}/{{ float }}/{{ decimal }}{% endlocalize %}"
1448 )
1449 context = Context(
1450 {"int": 1455, "float": 3.14, "decimal": decimal.Decimal("24.1567")}
1451 )
1452 with self.settings(
1453 DECIMAL_SEPARATOR=",",
1454 USE_THOUSAND_SEPARATOR=True,
1455 THOUSAND_SEPARATOR="°",
1456 NUMBER_GROUPING=2,
1457 ):
1458 self.assertEqual(template.render(context), "1455/3.14/24.1567")
1459
1460 def test_localized_as_text_as_hidden_input(self):
1461 """

Callers

nothing calls this directly

Calls 4

renderMethod · 0.95
TemplateClass · 0.90
ContextClass · 0.90
settingsMethod · 0.45

Tested by

no test coverage detected