| 4825 | self.assertEqual(rrset.count(), 4) |
| 4826 | |
| 4827 | def testSetExDateCount(self): |
| 4828 | # Test that the count is updated when an rdate is added |
| 4829 | for cache in (True, False): |
| 4830 | rrset = rruleset(cache=cache) |
| 4831 | rrset.rrule(rrule(YEARLY, count=2, byweekday=TH, |
| 4832 | dtstart=datetime(1983, 4, 1))) |
| 4833 | rrset.rrule(rrule(WEEKLY, count=4, byweekday=FR, |
| 4834 | dtstart=datetime(1991, 6, 3))) |
| 4835 | |
| 4836 | # Check the length twice - first one sets a cache, second reads it |
| 4837 | self.assertEqual(rrset.count(), 6) |
| 4838 | self.assertEqual(rrset.count(), 6) |
| 4839 | |
| 4840 | # This should invalidate the cache and force an update |
| 4841 | rrset.exdate(datetime(1991, 6, 28)) |
| 4842 | |
| 4843 | self.assertEqual(rrset.count(), 5) |
| 4844 | self.assertEqual(rrset.count(), 5) |
| 4845 | |
| 4846 | |
| 4847 | class WeekdayTest(unittest.TestCase): |