A string representation is returned for unlocalized numbers.
(self)
| 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 | """ |