summaryrefslogtreecommitdiff
path: root/tests/humanize_tests
diff options
context:
space:
mode:
authorHasan Ramezani <hasan.r67@gmail.com>2018-11-11 01:09:37 +0100
committerTim Graham <timograham@gmail.com>2018-11-10 19:09:37 -0500
commitc7cc7526d5ee7d38a6ee1af03610f1aba1ea0c78 (patch)
tree3bedc6311b3582e65d84e7f3ec32cfbb9d2c69b2 /tests/humanize_tests
parent961f8e99850ecb334d63a943b53b3cb1180ef538 (diff)
downloaddjango-c7cc7526d5ee7d38a6ee1af03610f1aba1ea0c78.tar.gz
Completed test coverage of contrib.humanize.templatetags.humanize.
Diffstat (limited to 'tests/humanize_tests')
-rw-r--r--tests/humanize_tests/tests.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/tests/humanize_tests/tests.py b/tests/humanize_tests/tests.py
index 25cd07bac7..16e8fa6bfd 100644
--- a/tests/humanize_tests/tests.py
+++ b/tests/humanize_tests/tests.py
@@ -98,12 +98,13 @@ class HumanizeTests(SimpleTestCase):
test_list = (
'100', '1000000', '1200000', '1290000', '1000000000', '2000000000',
'6000000000000', '1300000000000000', '3500000000000000000000',
- '8100000000000000000000000000000000', None,
+ '8100000000000000000000000000000000', None, ('1' + '0' * 100),
+ ('1' + '0' * 104),
)
result_list = (
'100', '1.0 million', '1.2 million', '1.3 million', '1.0 billion',
'2.0 billion', '6.0 trillion', '1.3 quadrillion', '3.5 sextillion',
- '8.1 decillion', None,
+ '8.1 decillion', None, '1.0 googol', ('1' + '0' * 104),
)
with translation.override('en'):
self.humanize_tester(test_list, result_list, 'intword')
@@ -183,7 +184,9 @@ class HumanizeTests(SimpleTestCase):
def utcoffset(self, dt):
return None
test_list = [
+ 'test',
now,
+ now - datetime.timedelta(microseconds=1),
now - datetime.timedelta(seconds=1),
now - datetime.timedelta(seconds=30),
now - datetime.timedelta(minutes=1, seconds=30),
@@ -205,6 +208,8 @@ class HumanizeTests(SimpleTestCase):
now.replace(tzinfo=utc),
]
result_list = [
+ 'test',
+ 'now',
'now',
'a second ago',
'30\xa0seconds ago',