(self)
| 14 | today = date(2003, 9, 17) |
| 15 | |
| 16 | def testInheritance(self): |
| 17 | # Ensure that relativedelta is inheritance-friendly. |
| 18 | class rdChildClass(relativedelta): |
| 19 | pass |
| 20 | |
| 21 | ccRD = rdChildClass(years=1, months=1, days=1, leapdays=1, weeks=1, |
| 22 | hours=1, minutes=1, seconds=1, microseconds=1) |
| 23 | |
| 24 | rd = relativedelta(years=1, months=1, days=1, leapdays=1, weeks=1, |
| 25 | hours=1, minutes=1, seconds=1, microseconds=1) |
| 26 | |
| 27 | self.assertEqual(type(ccRD + rd), type(ccRD), |
| 28 | msg='Addition does not inherit type.') |
| 29 | |
| 30 | self.assertEqual(type(ccRD - rd), type(ccRD), |
| 31 | msg='Subtraction does not inherit type.') |
| 32 | |
| 33 | self.assertEqual(type(-ccRD), type(ccRD), |
| 34 | msg='Negation does not inherit type.') |
| 35 | |
| 36 | self.assertEqual(type(ccRD * 5.0), type(ccRD), |
| 37 | msg='Multiplication does not inherit type.') |
| 38 | |
| 39 | self.assertEqual(type(ccRD / 5.0), type(ccRD), |
| 40 | msg='Division does not inherit type.') |
| 41 | |
| 42 | def testMonthEndMonthBeginning(self): |
| 43 | self.assertEqual(relativedelta(datetime(2003, 1, 31, 23, 59, 59), |
nothing calls this directly
no test coverage detected