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