Show More
@@ -129,6 +129,8 b' class TestLibs(unittest.TestCase):' | |||||
129 | self.assertEqual(age(n - delt(hours=1)), u'1 hour ago') |
|
129 | self.assertEqual(age(n - delt(hours=1)), u'1 hour ago') | |
130 | self.assertEqual(age(n - delt(hours=24)), u'1 day ago') |
|
130 | self.assertEqual(age(n - delt(hours=24)), u'1 day ago') | |
131 | self.assertEqual(age(n - delt(hours=24 * 5)), u'5 days ago') |
|
131 | self.assertEqual(age(n - delt(hours=24 * 5)), u'5 days ago') | |
|
132 | self.assertEqual(age(n - delt(hours=24 * (calendar.mdays[n.month - 1]))), | |||
|
133 | u'1 month ago') | |||
132 | self.assertEqual(age(n - delt(hours=24 * (calendar.mdays[n.month - 1] + 2))), |
|
134 | self.assertEqual(age(n - delt(hours=24 * (calendar.mdays[n.month - 1] + 2))), | |
133 | u'1 month and 2 days ago') |
|
135 | u'1 month and 2 days ago') | |
134 | self.assertEqual(age(n - delt(hours=24 * 400)), u'1 year and 1 month ago') |
|
136 | self.assertEqual(age(n - delt(hours=24 * 400)), u'1 year and 1 month ago') | |
@@ -144,7 +146,9 b' class TestLibs(unittest.TestCase):' | |||||
144 | self.assertEqual(age(n + delt(hours=1)), u'in 1 hour') |
|
146 | self.assertEqual(age(n + delt(hours=1)), u'in 1 hour') | |
145 | self.assertEqual(age(n + delt(hours=24)), u'in 1 day') |
|
147 | self.assertEqual(age(n + delt(hours=24)), u'in 1 day') | |
146 | self.assertEqual(age(n + delt(hours=24 * 5)), u'in 5 days') |
|
148 | self.assertEqual(age(n + delt(hours=24 * 5)), u'in 5 days') | |
147 |
self.assertEqual(age(n + delt(hours=24 * (calendar.mdays[n.month |
|
149 | self.assertEqual(age(n + delt(hours=24 * (calendar.mdays[n.month]))), | |
|
150 | u'in 1 month') | |||
|
151 | self.assertEqual(age(n + delt(hours=24 * (calendar.mdays[n.month] + 1))), | |||
148 | u'in 1 month and 1 day') |
|
152 | u'in 1 month and 1 day') | |
149 | self.assertEqual(age(n + delt(hours=24 * 400)), u'in 1 year and 1 month') |
|
153 | self.assertEqual(age(n + delt(hours=24 * 400)), u'in 1 year and 1 month') | |
150 |
|
154 |
General Comments 0
You need to be logged in to leave comments.
Login now