def test_users(self): cohort = self.mox.CreateMockAnything() cohort.users = User.objects.all() self.mox.ReplayAll() self.assertEqual(list(Period(cohort, start_day=1, end_day=30).users), [self.user]) self.assertEqual(list(Period(cohort, start_day=30, end_day=60).users), []) self.mox.VerifyAll()
def test_length(self): period = Period(cohort=None, start_day=1, end_day=30) self.assertEqual(period.length(), 29)