Esempio n. 1
0
 def test_represent_days_only(self):
     self.assertEqual('2 days', humanize_days(23, display_days=True))
Esempio n. 2
0
 def test_represent_months_only(self):
     self.assertEqual('1 month', humanize_days(32, display_months=True))
Esempio n. 3
0
 def test_represent_weeks_only(self):
     self.assertEqual('3 weeks', humanize_days(23, display_weeks=True))
Esempio n. 4
0
 def test_should_represent_negative_weeks(self):
     self.assertEqual('11 months, 4 weeks, 2 days', humanize_days(-365))
Esempio n. 5
0
 def test_represent_years_only(self):
     self.assertEqual('1 year', humanize_days(366, display_years=True))
Esempio n. 6
0
 def test_should_represent_negative_days(self):
     self.assertEqual('3 days', humanize_days(-3))
Esempio n. 7
0
 def test_should_represent_negative_weeks(self):
     self.assertEqual('4 weeks, 1 day', humanize_days(-29))
Esempio n. 8
0
 def test_should_represent_today(self):
     self.assertEqual('0 days', humanize_days(0))
Esempio n. 9
0
 def test_should_represent_negative_day(self):
     self.assertEqual('1 day', humanize_days(-1))
Esempio n. 10
0
 def test_should_obmit_days_if_zero(self):
     self.assertEqual('1 year, 1 week', humanize_days(372))
Esempio n. 11
0
 def test_should_represent_one_day(self):
     self.assertEqual('1 day', humanize_days(1))
Esempio n. 12
0
 def test_should_skip_months_if_less_than_a_month(self):
     self.assertEqual('4 weeks, 1 day', humanize_days(29))
Esempio n. 13
0
 def test_should_obmit_weeks_if_zero(self):
     self.assertEqual('1 year, 1 day', humanize_days(366))
Esempio n. 14
0
 def test_should_obmit_year_weeks_and_days_if_zero(self):
     self.assertEqual('11 months', humanize_days(334))
Esempio n. 15
0
 def test_should_skip_years_if_less_than_a_year(self):
     self.assertEqual('11 months, 4 weeks, 2 days', humanize_days(364))
Esempio n. 16
0
 def test_should_skip_weeks_and_days_if_zero(self):
     self.assertEqual('2 years', humanize_days(730))