|
@@ -1,5 +1,6 @@
|
|
|
from __future__ import unicode_literals
|
|
|
import datetime
|
|
|
+from decimal import Decimal
|
|
|
|
|
|
try:
|
|
|
import pytz
|
|
@@ -58,20 +59,20 @@ class HumanizeTests(TestCase):
|
|
|
|
|
|
def test_intcomma(self):
|
|
|
test_list = (100, 1000, 10123, 10311, 1000000, 1234567.25,
|
|
|
- '100', '1000', '10123', '10311', '1000000', '1234567.1234567',
|
|
|
+ '100', '1000', '10123', '10311', '1000000', '1234567.1234567', Decimal('1234567.1234567'),
|
|
|
None)
|
|
|
result_list = ('100', '1,000', '10,123', '10,311', '1,000,000', '1,234,567.25',
|
|
|
- '100', '1,000', '10,123', '10,311', '1,000,000', '1,234,567.1234567',
|
|
|
+ '100', '1,000', '10,123', '10,311', '1,000,000', '1,234,567.1234567', '1,234,567.1234567',
|
|
|
None)
|
|
|
|
|
|
self.humanize_tester(test_list, result_list, 'intcomma')
|
|
|
|
|
|
def test_l10n_intcomma(self):
|
|
|
test_list = (100, 1000, 10123, 10311, 1000000, 1234567.25,
|
|
|
- '100', '1000', '10123', '10311', '1000000', '1234567.1234567',
|
|
|
+ '100', '1000', '10123', '10311', '1000000', '1234567.1234567', Decimal('1234567.1234567'),
|
|
|
None)
|
|
|
result_list = ('100', '1,000', '10,123', '10,311', '1,000,000', '1,234,567.25',
|
|
|
- '100', '1,000', '10,123', '10,311', '1,000,000', '1,234,567.1234567',
|
|
|
+ '100', '1,000', '10,123', '10,311', '1,000,000', '1,234,567.1234567', '1,234,567.1234567',
|
|
|
None)
|
|
|
|
|
|
with self.settings(USE_L10N=True, USE_THOUSAND_SEPARATOR=False):
|