Skip to content

Commit

Permalink
Completed test coverage of contrib.humanize.templatetags.humanize.
Browse files Browse the repository at this point in the history
  • Loading branch information
hramezani authored and timgraham committed Nov 11, 2018
1 parent 961f8e9 commit c7cc752
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions tests/humanize_tests/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,12 +98,13 @@ def test_intword(self):
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')
Expand Down Expand Up @@ -183,7 +184,9 @@ class naive(datetime.tzinfo):
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),
Expand All @@ -205,6 +208,8 @@ def utcoffset(self, dt):
now.replace(tzinfo=utc),
]
result_list = [
'test',
'now',
'now',
'a second ago',
'30\xa0seconds ago',
Expand Down

0 comments on commit c7cc752

Please sign in to comment.