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